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
9966 [12]
3 years ago
8

2. Write a program that initializes an array of characters with the phrase, "Take me to Clearwater Beach!". Using pointers, scan

the array to make each character upper case. The catch: you may NOT use the isupper(), islower(), toupper(), or tolower() functions. You must calculate whether a character is upper or lower case, and use the same logic to convert to upper case where applicable
Computers and Technology
1 answer:
navik [9.2K]3 years ago
6 0

Answer:

Written in C++

#include<iostream>

using namespace std;

int main() {

char myword[] = {'T','a','k','e',' ','m','e',' ','t','o',' ','C','l','e','a','r','w','a','t','e','r',' ','B','e','a','c','h','!', '\0'};

for (char *i = myword; *i != '\0'; ++i){

if( *i >= 'a' && *i <= 'z'){

           *i -= 'a' - 'A';    

       }

   }

   cout<<myword;

   return 0;

}

Explanation:

This line initializes the string to a char array

char myword[] = {'T','a','k','e',' ','m','e',' ','t','o',' ','C','l','e','a','r','w','a','t','e','r',' ','B','e','a','c','h','!', '\0'};

This iterates through the char array

for (char *i = myword; *i != '\0'; ++i){

This checks for uppercase or lowercase

if( *i >= 'a' && *i <= 'z'){

This converts to lowercase

           *i -= 'a' - 'A';

       }

   }

This prints the new string in all uppercase

   cout<<myword;

You might be interested in
On the Audio Tools contextual tab, which tab will control how the audio file appears, if it appears, on the slide itself?
dexar [7]

Answer:

B.

Explanation:

3 0
3 years ago
Read 2 more answers
A compound Boolean expression created with the _________ operator is true if either of its subexpressions is true.
lbvjy [14]
The answer for the question is butt
3 0
3 years ago
Why is hydrgoen in any group on the periodic table
Radda [10]

Answer:

Hydrogen is placed above group in the periodic table because it has ns1 electron configuration like the alkali metals. However, it varies greatly from the alkali metals as it forms cations (H+) more reluctantly than the other alkali metals. ... Hydrogen has a much smaller electron affinity than the halogens.

8 0
3 years ago
Read 2 more answers
If Rahul wants to reduce his monthly spending, he should A get a better job. B reduce his fixed expenses. C reduce his variable
Ilia_Sergeevich [38]

Answer:

C. reduce his variable expenses.

Explanation:

There are two types of expenses: Variable expenses and Fixed Expenses. Fixed Expenses are the expenses that are fixed for every month and its difficult to reduce these expenses such as house rent, fuel or travel expenses to go for work, utility bills. These are almost fixed for every month and it is difficult to reduce them. On the other hand, variable expense are the expense that vary for every month and can reduce easily. These expenses includes eating outside at restaurants, clothing, enjoying and arranging parties.

Rahul should reduce his variable expense to reduce his spending. This could be the easier way to reduce the expenses and save more. First option is not valid as he want to reduce his spending, this shows that he is satisfied with his current job but worried about extra expenses each month. This is the reason option C is the better choice for him to reduce expense.

6 0
3 years ago
What is piracy? (1 point)
QveST [7]

Answer:

B

Explanation:

4 0
3 years ago
Other questions:
  • To order the records in the answer to a query in a particular way, you ____ the records.
    11·1 answer
  • Convert the following three hexadecimal numbers to both binary and decimal. (Hint: it is probably easier to convert hex to binar
    6·1 answer
  • ILL GIVE BRAINLIEST You are taking a photograph of a valley and want to draw attention to a hamlet hidden amid the hills. Which
    10·2 answers
  • When users talk about font size,
    10·2 answers
  • What does it mean by MYRIAD of data?
    9·1 answer
  • Front and rear camber and toe settings are being adjusted during a four-wheel alignment. The correct order for performing these
    13·1 answer
  • When mapping a drive, you can type in the path to the shared folder on the host computer. what is the syntax for the path?
    7·1 answer
  • What will you see on the next line?
    6·2 answers
  • Part of metacognition involves making a plan to address <br> .
    9·2 answers
  • Which document would be best created using Word online
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!