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
What kind of battery does a dji spark have?
shutvik [7]
Lithium-Ion Battery. The same kind of battery found in smartphones, laptops, etc.
6 0
4 years ago
Mobile devices need to work within limited screen space .
zloy xaker [14]
True. Mobile devices need to work within limited screen space. Mobile devices are designed to be portable and designed to be carried around without hassle. Mobile devices are used for personal activities such as talking privately, chatting and many more that is why it is designed to be small.
3 0
4 years ago
You can remove selected text from a slide by pressing ctrl+x keyboard shortcut keys true or false
Serhud [2]
Yes, I believe so. It will cut/delete the part of the sentence you highlighted, then it will be saved to be put somewhere else. Just press ctrl-v to paste the deleted sentence. (True)
5 0
4 years ago
Please tell fast plzzzzzz. ​
shepuryov [24]

Answer:

true....................

6 0
3 years ago
Read 2 more answers
1. What is the difference between background sound and nat sound
OleMash [197]

Answer:

Well the background sound is the sound of course in the background and the nat sound is the curremt sound

Explanation:

6 0
2 years ago
Other questions:
  • Using a wireless network without the network owner's permission is known as ________.
    15·1 answer
  • What are some objects in your home that demonstrate electrical energy to radiant energy to thermal energy
    10·2 answers
  • The computer system provides an internal clock that sends an interrupt periodically to the CPU signaling that it’s time to start
    11·1 answer
  • Which do switches create?<br> Networks<br> Wireless access points<br> Routes<br> Collision domains
    5·1 answer
  • Preventive Maintenance will will reduce potential hardware and Software Problems. Select two factors based on which Preventive m
    5·1 answer
  • What is the georgia connections academy administrative password? i want to install something.
    5·1 answer
  • Create a class Car, which contains Three data members i.e. carName (of string type), ignition (of bool type), and currentSpeed (
    7·1 answer
  • After turning volume all the way up on your computer speaker you still can’t hear any sound. What should be done next
    15·1 answer
  • n (m,n) correlating branch predictor uses the behavior of the most recent m executed branches to choose from 2m predictors, each
    11·1 answer
  • A computer hardware feature that is vital to the effective operation of a multiprogramming operating system is:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!