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
What is the best way to set up the spreadsheet? List each expense in a row. List each income source in a column. List each expen
VLD [36.1K]

Answer:

is b

Explanation:

8 0
3 years ago
Read 2 more answers
What feature is available to add a suggestion in the margin of someone else's document? Annotation Bookmark Comment Highlight
Step2247 [10]
Comment i think is the answer
4 0
4 years ago
Read 2 more answers
The while loop is a pre-test loop? TRUE OR FALSE
mihalych1998 [28]
True

Hope I helped! 

Let me know if you need anything else!

~ Zoe
5 0
4 years ago
Read 2 more answers
Sal Kan earned $3,000.00, But he is only getting $1,585.00 on his pay check to
svetlana [45]

Answer:

Usually, it's because of taxes and insurance.

3 0
3 years ago
What's usually kept in database?
Levart [38]
I think this is the answer. I tried. Databases<span> may be </span>stored<span> on a computer and examined using a programs.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which computer device helps you input data in the form of text, numbers, and commands?
    9·1 answer
  • A(n) _____ can be used to convert digitized documents into ascii (american standard code for information interchange) text that
    6·1 answer
  • Which naming scheme identifies the columns of a worksheet?
    12·1 answer
  • “You have been blocked”
    5·2 answers
  • Hey you know Python? Could you help me, please? It's for my Final please help me SOS.
    8·1 answer
  • A remediation liaison makes sure all personnel are aware of and comply with an organization's policies.
    9·1 answer
  • (Shuffle rows) Write a method that shuffles the rows in a two-dimensional int array using the following header: public static vo
    12·1 answer
  • What is the benefit of encapsulation?
    14·1 answer
  • What is considered an important ethical consideration when working with families
    13·1 answer
  • Which html tag designates links to other web pages?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!