599 Answered Questions for the topic C++

C++

06/06/21

Create Doubly Linked List in C++

Doubly Linked ListA doubly linked list is a type of linked list in which each node apart from storing its data has two links. The first link points to the previous node in the list and the second... more
C++

06/06/21

Create a digits application C++

Create a digits application to show the hundreds-place digit of a three-digit number. The user will always enter three digits. The application output the three-digit separately.
C++

06/06/21

C++ program has errors - fix them

The following C++ program has errors at the lines marked a,b,c,d, and e. For each answer write a single line of C++ that fixes all errors in the corresponding line. Do not change anything that is... more

RPS Enumeration. Use the given enumerations to write a function Result getResult(Choice player1, Choice player2) .

Use the given enumerations to write a function Result getResult(Choice player1, Choice player2) . It should determine the winner of a round of Rock, Paper, Scissors between two players (Rock beats... more

Suits. The starter code below has code to keep track of the suits in a card game.

The starter code below has code to keep track of the suits in a card game. They are defined in an order such that clubs are the best suit (highest number), followed by diamonds, spades and then... more

Directions. Define a enumerated type Direction to make the following code work correctly.

Define a enumerated type Direction to make the following code work correctly. It should associate EAST with the value 0, NORTH with the value 90, WEST with 180 and SOUTH with 270.Code:#include... more

C++ Design Pattern Problem

You're given 3 shapes: rectangle, triangle and circle. Your task is to find if one shape is contained in another shape. Define this function as a new operation (e.g. bool isContained()) without... more

05/21/21

C++ question Pritty’s Program

Pritty’s Program After going through the problem-solving process Pritty finally arrived at this stage; the one just before she begins to write the code. PLAN 1, Write a message politely asking the... more
C++

05/20/21

computer engineering

Write a function to output patient information that are stored in a file. One of the parameters of the function must be no. of patients to output and another one the name of the file where the... more

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.