Question: #include using namespace std; /* This program calculates the amount of pasta to cook, given the number of people eating. Author: Mario Boyardee Date: May

#include  using namespace std; /* This program calculates the amount of pasta to cook, given the number of people eating. Author: Mario Boyardee Date: May 30, 2017 */ int main() { int numPeople; // Number of people that will be eating int totalOuncesPasta; // Total ounces of pasta to serve numPeople // Get number of people cout << "Enter number of people: " << endl; cin >> numPeople; // Calculate and print total ounces of pasta totalOuncesPasta = numPeople * 3; // Typical ounces per person cout << "Cook " << totalOuncesPasta << " ounces of pasta." << endl; return 0; }

Indicate which are valid code.

1)

// Get user input

Valid

Invalid

2)

/* Get user input */

Valid

Invalid

3)

/* Determine width and height, calculate volume, and return volume squared. */

Valid

Invalid

4)

// Print "Hello" to the screen //

Valid

Invalid

5)

// Print "Hello" Then print "Goodbye" And finally return. //

Valid

Invalid

6)

/* * Author: Michelangelo * Date: 2014 * Address: 111 Main St, Pacific Ocean */

Valid

Invalid

7)

// numKids = 2; // Typical number

Valid

Invalid

8)

/* numKids = 2; // Typical number numCars = 5; */

Valid

Invalid

9)

/* numKids = 2; /* Typical number */ numCars = 5; */

Valid

Invalid

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!