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 are the types of action involving data base?
Alexeev081 [22]

Answer: The DBMS is a software system that explains the four types of actions, which are defining, constructing, manipulating, and sharing databases among various users and applications.

3 0
3 years ago
Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to
MAVERICK [17]

Answer:

~CaptnCoderYankee

Don't forget to award brainlyest if I got it right!

Download txt
5 0
3 years ago
Is techonology better? Lot of votes needed.
Nataliya [291]
In some ways yes but others... not so much. we have access to amazing things that can help so many people and some are tearing people apart or are used for illegal things. its really everyone's own opinion because of some interactions (positive or negative) that can influence them.
5 0
3 years ago
The value of the mathematical constant e can be expressed as an infinite series: e=1+1/1!+1/2!+1/3!+... Write a program that app
LUCKY_DIMON [66]

Answer:

// here is code in c++ to find the approx value of "e".

#include <bits/stdc++.h>

using namespace std;

// function to find factorial of a number

double fact(int n){

double f =1.0;

// if n=0 then return 1

if(n==0)

return 1;

for(int a=1;a<=n;++a)

       f = f *a;

// return the factorial of number

return f;

}

// driver function

int main()

{

// variable

int n;

double sum=0;

cout<<"enter n:";

// read the value of n

cin>>n;

// Calculate the sum of the series

  for (int x = 0; x <= n; x++)

  {

     sum += 1.0/fact(x);

  }

  // print the approx value of "e"

    cout<<"Approx Value of e is: "<<sum<<endl;

return 0;

}

Explanation:

Read the value of "n" from user. Declare and initialize variable "sum" to store the sum of series.Create a function to Calculate the factorial of a given number. Calculate the sum of all the term of the series 1+1/1!+1/2!.....+1/n!.This will be the approx value of "e".

Output:

enter n:12

Approx Value of e is: 2.71828

6 0
3 years ago
How often should administrators and network users be required to change their password?
Sergeu [11.5K]
Once every 3 month's
8 0
3 years ago
Other questions:
  • Digital libraries are often available to students and/or employees at colleges, schools, and BLANK institutions.
    15·1 answer
  • Numeric data is stored in what for direct processing
    5·1 answer
  • How many mustangs are built every day
    13·2 answers
  • What are the ASE special certifications?
    14·2 answers
  • A form’s height is ______________________.<br><br> A property<br><br> A method<br><br> An event
    10·1 answer
  • Universal Containers is building an integration between Salesforce and their Accounting system. The integration will utilize out
    8·1 answer
  • What type of media is a hard disk​
    9·1 answer
  • What is the purpose of the Subtotal feature?
    9·1 answer
  • What type of hard disk is recommended for a Windows 10 VM?
    6·1 answer
  • When advertising on search engines, if you bid the same as your competitor, having a higher quality score will mean you appear w
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!