Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

What is one of the skills required for independent learning?Explain

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago