586 Answered Questions for the topic C++

String Compactor. Write code that will read in a string and then print out every other character of the string.

Write code that will read in a string and then print out every other character of the string. You should use getline to read in the string... it may have spaces.Samples: Input of "Hello" should... more

Count E's. Read in a string, print out the number of e's in it.

Read in a string, print out the number of e's in it. Note that the string may have spaces in it. A call to getline looks like getline(cin, myVariable) where myVariable is a string variable that... more

Read Text. Write a program that reads one character at a time and prints them out without spaces until it hits a period. Do not print the period.

Write a program that reads one character at a time and prints them out without spaces until it hits a period. Do not print the period.Input of:H e l l o .should result in output... more

Squares Adder. Write a program that reads in a number (integer) indicating how many values you are to read.

Write a program that reads in a number (integer) indicating how many values you are to read. Then read in that many more numbers (all integers) and output the sum of their squares.Input of 4 1 2 3... more

Counting 3. Write a program that reads in two chars, like B and F and prints all the characters in that range in the format:

Write a program that reads in two chars, like B and F and prints all the characters in that range in the format:B,C,D,E,FHints: Your loop variable should be a char. Remember you can add one to a... more

Counting 2. Read in three numbers. A start value, an increment value, and an end value (all integers). Start counting from the start, adding the increment at each step...

Read in three numbers. A start value, an increment value, and an end value (all integers). Start counting from the start, adding the increment at each step, until you are at or above the end... more

Counting 1. Write a program that reads in a number, and writes out from 1 to that number. An input of 5 would produce 12345.

Write a program that reads in a number, and writes out from 1 to that number. An input of 5 would produce 12345.Code:#include <iostream>using namespace std;int main(){ //YOUR_CODE}

Cell Labeler. In a spreadsheet, the rows are numbered and the columns are lettered, like this:

In a spreadsheet, the rows are numbered and the columns are lettered, like this: ABC 1 A1 B1 C1 2 A2 B2 C2 The code below reads in a number of rows and columns. Prints out the cells that would... more

Triangle Printer 2. The existing code reads in a number and prints a series of rows. Modify it so it prints a triangle that looks like the ones shown below.

The existing code reads in a number and prints a series of rows. Modify it so it prints a triangle that looks like the ones shown below. SizeShape 1 *2 * ** 3 * ** *** 4 * ** ... more

Triangle Printer. The existing code reads in a number and prints a column of stars that many rows long. Modify it so that it prints a triangle that looks like the one shown below.

The existing code reads in a number and prints a column of stars that many rows long. Modify it so that it prints a triangle that looks like the one shown... more

Square printer. Read in an integer. Print a square of *'s that height and width. An input of 3 should produce:

Read in an integer. Print a square of *'s that height and width. An input of 3 should produce: *** *** *** An input of 5 should produce: ***** ***** ***** ***** ***** Code:#include... more
C++

04/18/21

Parsing Dates C++

Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the... more

I need the implementations for all the classes in this project in C++

This is the link to all the instructions to the project, there should be a Shape class as the abstract parent class and circle, triangle, rectangle children classes which inherit from shape. Should... more

Implement an abstract parent Shape class and its polymorphic children Circle, Rectangle, and Triangle. 

Your objective for this project is to implement an abstract parent Shape class and its polymorphic children Circle, Rectangle, and Triangle. Shape is a 2D character array which requires the use of... more

Implement an abstract parent Shape class and its polymorphic children Circle, Rectangle, and Triangle

Your objective for this project is to implement an abstract parent Shape class and its polymorphic children Circle, Rectangle, and Triangle. Shape is a 2D character array which requires the use of... more

Catapult Calculator

Market research has indicated that the app store currently lacks a catapult calculator. Filling this void could be the get rich opportunity of a lifetime! Write a program that calculates whether a... more

Log Switcher. Read in a number (double). Print the power of two that the number represents.

Read in a number (double). Print the power of two that the number represents.C++11 added a log base 2 function, but you can also just use the formula: power = log(number) / log(2) where log is the... more

Int Range. Read in a decimal value. Print out the two integers it is between, smaller value first, with exactly one space in between them.

Read in a decimal value. Print out the two integers it is between, smaller value first, with exactly one space in between them. If it is an integer value already, your program should print out the... more

Cos Finder. Read in an angle in degrees and the length of the adjacent side to that angle in a right triangle (both as doubles). Print the length of the hypotenuse of the triangle.

Read in an angle in degrees and the length of the adjacent side to that angle in a right triangle (both as doubles). Print the length of the hypotenuse of the triangle.Use the formula hypotenuse =... more

Tangent Angle Finding. Read in the opposite and adjacent sides for one of the acute angles in a right triangle (as doubles). Print the size of the angle in radians.

Read in the opposite and adjacent sides for one of the acute angles in a right triangle (as doubles). Print the size of the angle in radians.Use the rule angleX = atan(opposite/adjacent) to find... more

Vowel Checker. Read in a character. Print vowel if it is a vowel (a, e, i, o, u, A, E, I, O, U) or consonant if it is not.

Read in a character. Print vowel if it is a vowel (a, e, i, o, u, A, E, I, O, U) or consonant if it is not.Hint: a nice trick to simplify your logic is to first convert the input to... more

Passcode Checker. Users of a system are supposed to pick a 3 character pass code such that there is at least one character that is a digit (number) and one character that is not a letter or number.

Users of a system are supposed to pick a 3 character pass code such that there is at least one character that is a digit (number) and one character that is not a letter or number. Something like... more

Next Two Letters. Read in a character (it will always be a lower case letter). Print out the two letters that come after it without any spaces. Once you go past 'z' you should wrap back to 'a'.

Read in a character (it will always be a lower case letter). Print out the two letters that come after it without any spaces. Once you go past 'z' you should wrap back to 'a'.Hint: You can add... more

Char Sorter. Write a program that sorts chars into 1 of 3 groups.

Write a program that sorts chars into 1 of 3 groups. Letters A-J are in group 1, K-P in group 2, Q-Z in group 3. You should read in one character and print out the group it belongs in - assume the... more

C++. Write a program that reads three integers from cin and outputs them in order from smallest to largest.

C++.Write a program that reads three integers from cin and outputs them in order from smallest to largest.Example: input of 3 8 5 should result in output of:3 5 8Hints: You do not have to actually... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.