Answered step by step
Verified Expert Solution
Question
1 Approved Answer
12345678 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
12345678 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 CECS 2203, Computer Programming I Lab *Fall 2021, Sec. 07 * Date: August 18, 2021 Topic: Lab 1 * File name: lab01.cpp * This program illustrates the use of a void method. * You must analyze the code, add any missing instructions, correct any errors, and execute the program. * * Execute the program two times, using the values * 21 and 22 as input. Make sure to take a screenshot! Name: YOUR NAME HERE, YOUR ID# HERE */ Bint main() { B - // write the appropriate include statement // write the appropriate using statement // Declare a method named procedure which has no return value 77 and requires no parameters B Void Methods B // Write the statement that declares the integer variable // seguir and initializes it to 1 // build a while iteration structure which uses the variable // seguir as sentinel and repeats the code while the value of // seguir is NOT equal to 0. { // call the procedure method cout < < "Enter 0 to finish, or any other number to continue: "; // Fill in the code to read and store the value in seguir Miscellaneous Files 34 35 36 37 38 39 40 wwww 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 8 (Global Scope) cout < < "Enter 0 to finish, or any other number to continue: "; // Fill in the code to read and store the value in seguir } // write a statement which prints the phrase // "Program developed by [YOUR NAME], ID# [YOUR ID NUMBER]" // where the square brackets and the text within is substituted with // your personal information. system("pause"); // for Visual Studio only return 0; // Define the procedure method, which has no parameters or return value // The function promts the user for a value, stores the value in an // integer variable, and determines if the number is odd or even. [// The method prints the result. Ereturn_data_type name() { 8 // Write the statement that declares the integer variable // number and initializes it to 0 cout < < "Enter a whole number: "; // Fill in the code to read and store the value in number cout < < The number < < number < < is; if (fill in the condition for odd or even) cout < < even < < endl; else cout < < odd < < endl;
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