586 Answered Questions for the topic C++
05/18/21
Row Sums. Write code for the function printRowSums.
Write code for the function printRowSums. It should print the sum of each row of the matrix (put a single space after each sum).For the matrix shown here:
1 2 3 4 5
6 7 8 9 10
You should print "15...
more
05/17/21
Row sums. Write code for the function printRowSums.
Write code for the function printRowSums. It should print the sum of each row of the matrix (put a single space after each sum).For the matrix shown here:
1 2 3 4 5
6 7 8 9 10
You should print "15...
more
05/17/21
Transpose. Write code for the function transpose.
Write code for the function transpose. It should take the matrix given and produce the transpose by swapping rows and columns.For the matrix shown here:
1 2 3
4 5 6
7 8 9
Your code should...
more
05/17/21
Row Sums. Write code for the function printRowSums.
Write code for the function printRowSums. It should print the sum of each row of the matrix (put a single space after each sum).For the matrix shown here:
1 2 3 4 5
6 7 8 9 10
You should print "15...
more
05/10/21
Swap Ends. The existing code reads in a size to NUM_VALUES, makes an array called values
The existing code reads in a size to NUM_VALUES, makes an array called values (I am cheating... do not make variable sized arrays!), and then reads in values for it. Your task is to swap the first...
more
05/10/21
Declare an array.
Declare an array of 5 doubles called values - initialize it with 1.6, 3.1, 8.3, 9.1, 4.8Code:#include <iostream>#include <iomanip>using namespace std;int main(){ const int NUM_VALUES...
more
05/10/21
Square Array. The existing codetries to make use of a function void squareArray(const int array[], int destination[], int size).
The existing codetries to make use of a function void squareArray(const int array[], int destination[], int size). This function should take each of the size elements from array, square the...
more
05/10/21
Add Negatives. The existing code is trying to call a function addNegatives that should take an array of ints and its size and return the sum of JUST the negative numbers from the array.
The existing code is trying to call a function addNegatives that should take an array of ints and its size and return the sum of JUST the negative numbers from the array. Your task is to write the...
more
05/04/21
C To F. Write a function: double celsiusToFahrenheit(double celsius)
Write a function:double celsiusToFahrenheit(double celsius)It should return the Fahrenheit temperature equivalent to the given Celsius temp.F = (9.0 / 5) * C + 32Code:#include...
more
05/04/21
String Trim2. Write a function stringTrim that removes the first and last characters from a given string.
Write a function stringTrim that removes the first and last characters from a given string. "chello" should become "hell".Your function must work correctly given the code in main shown below....
more
05/04/21
Midpoint Finder. Write a function: void findMidpoint(double x1, double y1, double x2, double y2, double& xMid, double& yMid)
Write a function:void findMidpoint(double x1, double y1, double x2, double y2, double& xMid, double& yMid)Assume x1, y1 and x2, y2 represent two coordinates on a Cartesian plane. Calculate...
more
05/03/21
MyMin. Write a function: int myMin(int num1, int num2)
Write a function:int myMin(int num1, int num2)It should return the lesser of the two parameters.Code:#include <iostream>using namespace std;//Do not modify anything on or above the line below...
more
05/03/21
C To F. Write a function: double celsiusToFahrenheit(double celsius)
Write a function:double celsiusToFahrenheit(double celsius)It should return the Fahrenheit temperature equivalent to the given Celsius temp.F = (9.0 / 5) * C + 32Code:#include...
more
05/03/21
String Trim2. Write a function stringTrim that removes the first and last characters from a given string.
Write a function stringTrim that removes the first and last characters from a given string. "chello" should become "hell".Your function must work correctly given the code in main shown below....
more
05/03/21
Midpoint Finder. Write a function:
Write a function:void findMidpoint(double x1, double y1, double x2, double y2, double& xMid, double& yMid)Assume x1, y1 and x2, y2 represent two coordinates on a Cartesian plane. Calculate...
more
04/30/21
How to Complete a Swap() Function while Using Other Functions from Other Files (C++)
Complete the Swap() function in main.cpp to exchange the values of the num field of two Number objects, num1 and num2. Since both num1 and num2 are changed inside Swap(), reference operators...
more
04/29/21
Determining If a Student Should Be on Probation Due to Their GPA (C++ Program)
A student is put on probation if their GPA is below 2.0. Complete the Course class by implementing the CountProbation() member function, which returns the number of students with a GPA below...
more
04/27/21
All To Upper. Read a string from cin into word and modify it so that it has all uppercase letters.
Read a string from cin into word and modify it so that it has all uppercase letters.Samples:
Input: hello Output: HELLO
Input: h3Llo Output: H3LLO
Hints:
You can only change the code in the...
more
04/27/21
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
04/26/21
Web Log Parser. Submit to elearn: Make sure to name files EXACTLY as specified - including capitalization. Do not submit extra files. Do not zip or otherwise compress files unless told to.
ObjectiveYouwill be able to read data from a file and use string functions to process text.Assignment InstructionsShould be able to compile and run your program with:
g++ -std=c++11 assign5.cpp -o...
more
04/26/21
Tag Remover. Read in a string that may have spaces (use getline!).
Read in a string that may have spaces (use getline!). In the string will be something that looks like [TAG]text inside tag[/TAG] where TAG can be any string. Print out the TAG, a colon, and the...
more
04/26/21
Sher. Write a word shortener.
Write a word shortener. Read in a string (you may assume no spaces). If it is 4 characters or less, print it back out. If it is more than 4 characters, print just the first two followed by the last...
more
04/26/21
Caturday Check. Read a string (will not have spaces).
Read a string (will not have spaces). Print "true" if the word "cat" appears starting at the first or second letter. Otherwise print false.Samples:
Input: catch Output: true
Input: scatter ...
more
04/26/21
First Middle Last Letter. Read in a string from cin (it will not have any whitespace).
Read in a string from cin (it will not have any whitespace). Print out the first character, middle character (if string is an even length, print the second of the two middle letters), and last...
more
04/26/21
All To Upper. Read a string from cin into word and modify it so that it has all uppercase letters.
Read a string from cin into word and modify it so that it has all uppercase letters.Samples:
Input: hello Output: HELLO
Input: h3Llo Output: H3LLO
Hints:
You can only change the code in the...
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.