1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gnesinka [82]
4 years ago
13

In this lab, you complete a partially written C++ program that includes built-in functions that convert characters stored in a c

haracter array to all uppercase or all lowercase. The program prompts the user to enter nine characters. For each character in the array, you call the built- in functions tolower() and toupper(). Both of these functions return a character with the character changed to uppercase or lowercase. Here is an example: char sample1 = 'A'; char sample 2a'; char result1, result2; result1 = tolower(sample1); result 2 = toupper(sample 2); The source code file provided for this lab includes the necessary variable declarations and the necessary input and output statements. Comments are included in the file to help you write the remainder of the program.
Computers and Technology
1 answer:
Sunny_sXe [5.5K]4 years ago
3 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   const int LENGTH = 9;

   char sample1[LENGTH];

   char sample2[LENGTH];

   

   cout << "Enter 9 characters to be converted to uppercase: ";

   

   for(int i = 0; i < LENGTH; i++){

   

       cin >> sample1[i];

       sample1[i] = toupper(sample1[i]);

       cout << sample1[i];

   }

   cout << endl;    

   cout << "Enter 9 characters to be converted to lowercase: ";

       

   for(int i = 0; i < LENGTH; i++){

       

       cin >> sample2[i];

       sample2[i] = tolower(sample2[i]);

       cout << sample2[i] ;

   }

   return 0;

}

Explanation:

- Declare the variables

- Ask the user for the characters

- Using for loop, convert these characters into uppercase and print them

- Ask the user for the characters

- Using for loop, convert these characters into lowercase and print them

You might be interested in
I need help. People who know computer science. I have selected a word from the first 1000 words in my dictionary. Using the bina
Rudiy27

Answer:

14

Explanation:

8 0
3 years ago
Discuss how does a Modulus Operator function
aliya0001 [1]

Answer:

Modulus operator are useful in many circumstances and it is commonly used to generate the random number. It basically reduce the number into random number in a small range.

It also describe that whether, the one number is a factor of another or not.

In C language, the modulus operator provide the remainder after diving the greater value with the smaller value. If the smaller number are divided by the larger number then, the quotient become zero.

6 0
3 years ago
What are the effects deforestation have on a river system?
Nikolay [14]
Deforestation affects rivers in these ways
1.There is a loss of habitat for wild animals
2. Destruction of land due to floods, mudslides, 
3. Water cycle and Animal Cycle are disturbed
( ex. transpiration rate; beavers building dams)
4. Greater amount of Green House gases


8 0
4 years ago
Why is it necessary to include units when measuring and dimensioning?
antoniya [11.8K]
Because the measurement is relative to the unit. For example:

A measurement is six. But could be 6 inches, 6 yards, 6 nm, 6 feet, six as a quantity, six packages, six items, etc.

So until you specify the unit, that number means nothing.
7 0
3 years ago
_3__ Include a knowledge based with accumulated experience and a set of rules for aplying the knowledge base to each particular
sweet-ann [11.9K]

Answer:

d:

Explanation

3 0
3 years ago
Other questions:
  • You are training to complete in a local 5K run. You record your time scores in minutes after completing seven practice runs. Wri
    5·1 answer
  • ________ is the process the compiler uses to divide your source code into meaningful portions; the message means that the compil
    7·1 answer
  • The repeated use of electronic communications, such as chat rooms and email, to seek out, harass, or frighten someone is called
    12·1 answer
  • Samantha is in the beginning stages of OOP program development. What are the five steps she must follow for creating an OOP prog
    6·2 answers
  • A(n) ____ local area network is a network in which devices use high-frequency radio waves to communicate with a base station, wh
    11·1 answer
  • When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it's appropri
    5·1 answer
  • Write a program that prompts the user to enter their name store this value in a variable called name Prompt the user for their c
    10·1 answer
  • What is the benefit of hosting a website on a personali
    6·1 answer
  • Read the following characteristic:
    14·1 answer
  • What is malware? What are some signs that malware may be impacting the performance of your computer? How can you avoid malware?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!