C++ Answers

Questions answered by Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Write a program that prompts the user to input a string, then convert each lowercase character in it to uppercase,

and all uppercase character to lowercase. You must use character array in implementing your solution.


Sample Run:

Enter a string: Computer PROGRAMMING is Fun!

cOMPUTER programming IS fUN!



No, it’s not!



Write a program that prompts the user to input as string, then replace each vowel the exists on that string with the


character '*'. You must use character array in implementing your solution.


Sample Run:

Enter a string: 'A' is for "Apple", 'a' - 'a' ... "apple".

'*' *s f*r "*ppl*", '*' - '*' ... "*ppl*


Array

Create a program that will ask a user to enter 5 positive numbers.

The program will then display the largest and the smallest value that was entered by the user.


write a program to calculate average accelaration


•      The Easy Living resort hotel wants you to write a program to calculate the base charge for its guests. The program should prompt the user for the room type ('G' for garden view, 'P' for pool view, or 'L' for lake view) and the number of days the guest is to stay. The program also should prompt for whether the guest is to have a refrigerator in the room and whether there is to be an extra bed in the room.


•      The Easy Living resort hotel wants you to write a program to calculate the base charge for its guests. The program should prompt the user for the room type ('G' for garden view, 'P' for pool view, or 'L' for lake view) and the number of days the guest is to stay. The program also should prompt for whether the guest is to have a refrigerator in the room and whether there is to be an extra bed in the room.


Write a program that prompts the user to input a string and outputs the string in uppercase letters. You must use a

character array to store the string.


Sample program:

Enter a string: hello world!, welcome to programming

HELLO WORLD!, WELCOME TO PROGRAMMING


Write a program in C++ using repetition structures to print the following pattern. You are not allowed to use nested loops. (USE WHILE LOOP OR DO WILE LOOP)

****

***-

**--

*---



ACTIVITY 3: i +


def sum(n):

a = 0

for i in range(n):

for j in range(n, i, -1):

a = a + j;

return a


1. How many times did the operation execute? 

Answer: n * n times

2. What is the final time complexity of the given algorithm?

Answer: O(n2)

3. What is the final space complexity of the given algorithm?

Answer: O(1


Defines the Array class that represents an array of integers. Please fulfill the following requirements

constructor, destructor, copy constructor

The function allows inputting data from the keyboard and the function displays to the screen for Array (2 functions)

The function allows to assign (write) and the function to get (read) the value of a certain element in the Array (2 functions)

Write a main program that illustrates how to use it


LATEST TUTORIALS
APPROVED BY CLIENTS