12345678 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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; 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;
Expert Answer:
Related Book For
Computer Systems A Programmers Perspective
ISBN: 9781292101767
3rd Global Edition
Authors: Randal E. Bryant, David R. O'Hallaron
Posted Date:
Students also viewed these programming questions
-
(20 points)Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, convert the sum to the nearest integer, and print the result....
-
Given the definition of the radian angle: S l Where [s] = m, [4] = m What are the dimensions of angles? A. No way to know B. meters, m C. 1 (or no units/dimensions) D. seconds, S E. kilograms, kg
-
From the following data, calculate the retained earnings balance as of December 31, 2016: Retained earnings, December 31. 2015.......................................5623,600 Cost of equipment...
-
Research and explain to the Client the following: What is the Weighted Average Cost of Capital (WACC) Why companies compute weighted average cost of capital Whether WACC can be used to value an...
-
On April 30, 2010, Citibank loaned $100,000 to Grant Hughes on a one-year, 6% note. Requirements 1. Compute the interest for the years ended December 31,2010 and 2011, on the Hughes note. 2. Which...
-
The following income statements were drawn from the annual reports of Pierro Sales Company. The president's message in the company's annual report stated that the company had implemented a strategy...
-
Let (t) = (2+2 + 1, 3e*, -2 sin(3t)) Find the unit tangent vector T (t) at the point t = 0 T(0) = = < >
-
1. Suppose you wanted to predict Winnings ($) using only the number of poles won (Poles), the number of wins (Wins), the number of top five finishes (Top 5), or the number of top ten finishes (Top...
-
Water is added to 53.0 mL of a 1.30 M solution to give a volume of 228 mL. 114 mL is taken from that solution and 109 mL of water is added. Calculate the concentration of this final solution.
-
Consider the following data for two products of Vigano Manufacturing. Activity Machine setup Parts handling Quality inspections Total budgeted overhead Unit Information Units produced Direct...
-
A simple, yet powerful model for spark ignition engines is the Otto cycle. In the ideal Otto Cycle, the spark, the fuel and the intake/exhaust stages are replaced with simpler stages. There are 4...
-
What key milestone is triggered when the project charter is signed?
-
A manufacturer uses normal costing and allocates manufacturing overhead costs to products on the basis of Machine hours in the Machining Department and on the basis of Direct labor hours in the...
-
Companies need staff. Some positions require specialized training while others are considered entry-level and do not require education, certification, licensure, or advanced skills. An array of...
-
3. A firm has been using the following equation to predict annual demand for helix gears: Yt= 55+ 4t, where t is in years. Thus, the prediction for year 2 is 55 +4*2 = 63 Demand for the past few...
-
Provide a draft/outline of legal research involving an indigenous Canadian woman charged with assault causing bodily harm under (Sec 267b) of the Criminal Code, where the crown wants a 12-month jail...
-
Suppose the order of the third and fourth cases (the two forwarding sources from the memory stage) in the HCL code for d_valA were reversed. Describe the resulting behavior of the rrmovq instruction...
-
Determine the byte encoding of the Y86-64 instruction sequence that follows. The line .pos 0x100 indicates that the starting address of the object code should be 0x100. .pos 0x100 # Start code at...
-
List all of the possible output sequences for the following program: 1 int main() 2 { 3 4 5 6 7 8 9 10 11 12 } if (Fork() == 0) { printf("9"); fflush(stdout); } else { printf ("0"); fflush(stdout);...
-
The purpose of a link is to (a) transmit motion (b) guide other links (c) act as a support (d) all of the above.
-
Calculate the number of degrees of freedom of the mechanisms shown in Fig.1.53. (a) (b) Fig.1.53 Various types of mechanisms (c)
-
A kinematic chain requires at least (a) 2 links and 3 turning pairs (b) 3 links and 4 turning pairs (c) 4 links and 4 turning pairs (d) 5 links and 4 turning pairs.
Study smarter with the SolutionInn App