Answered step by step
Verified Expert Solution
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
#includeusing 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started