Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DO ASSIGNMENT * Solution/Project Name: * File Name: Client.cpp * * This file defines the entry point method, main(), for a C++ Console * application.

image text in transcribedimage text in transcribed

DO ASSIGNMENT

* Solution/Project Name: * File Name: Client.cpp * * This file defines the entry point method, main(), for a C++ Console * application. When the executable file is selected for execution, the OS * will transfer execution to the first line of code in method main(). Other * methods called from main() may be defined here as well. * * Revision Date Release Comment * -------- ---------- ------------------------------------------------------- * 1.0 MM/DD/YYYY Initial Release * * Program Inputs * -------------- * Device Description * -------- ------------------------------------------------------------------- * Keyboard * * Program Outputs * --------------- * Device Description * -------- ------------------------------------------------------------------- * Monitor * * File Methods * ------------ * Name Description * ------------ --------------------------------------------------------------- * main Program entry point method * ******************************************************************************* */ // External Definition files // 1. C++ Library files #include // Defines objects and classes used for stream I/O //#include // Defines the stream Manipulators //#include // Defines C++ Class: string // 2. ADT Class Definitions #include "Class.h" // Change name to actual class name OR delete if appropriate

using namespace std; // Announces to the compiler that members of the // namespace "std" are utilized in this program

// Method Prototypes // ----------------- // None

/****************************************************************************** * Method: main() * * Method Description * ------------------ * This is the entry function to the Client, Console program * *** Provide your description of the program here *** * * * Preconditions * ------------- * *** Must be completed, state "None" if there are no preconditions *** * * Method Arguments * ---------------- * Type name Description * ------ -------- ----------------------------------------------------------- * *** If no arguments, replace 2 lines with: No arguments required *** * * Return Value * ------------ * Type Description * -------- ------------------------------------------------------------------- * int Program execution status: 0 - No errors * *** If "void", state: The method returns no value *** * * Invoked File Methods * -------------------- * Name Description * ---------- ----------------------------------------------------------------- * *** If no additional file methods, replace 2 lines with: None *** * ******************************************************************************* */ int main() { // Constant "const" Value Declarations const int NO_ERRORS = 0; // Program Execution Status: No errors

// Initialized Variable Declarations int programStatus = NO_ERRORS; // Assume no program execution errors // Uninitialized Variable Declarations

// Insert your code here *** remove this line ***

// This prevents the Visual Studio Console Window from closing during // debug mode. // This next statement purges any characters, if any, remaining in the // Console input buffer, BEFORE "cin.get()" looks for the "new line" // character. cin.ignore(cin.rdbuf()->in_avail(), ' '); cout

// Inform the OS of the execution status of the program return programStatus;

} // End Method: main()

CS 300 Project \#1 30 points Basic C++ Concepts: Arithmetic Game General Instructions: You are to utilize the template, source code file for an assigned Project solution, Client.cpp, provided on the Canvas website for this course. You must provide comments in the code you provide and complete the required sections of the file comment header block and the method comment header block preceding method main. You are to create a program that requires the User to provide the answer for the sum of two, 3-digit at most, values presented to the User. The program will indicate if the answer is correct, and if not, provide the correct answer. In addition, the User is allowed to play the game again. Specific Instructions: 1. Provide a description of the game to the User. 2. You must use the ' C ' random number generator to create the two addend values provided to the User. You must "seed" the generator, just once, with the current time. 3. The addend values must be in the inclusive range: 10130. 4. You are to provide a separate method that returns a random value given the "min" and "max" method argument values. Name the method randomValue. Copy the comment header block for main, pasting it preceding the method and modify the required sections as needed. 5. Use a loop construct suitable for being executed at least once to prompt the User if the game is to be repeated. If the answer is the character ' y ', the game is repeated until any answer other than ' y ' is entered. Project Submissions: Using the Canvas Assignment upload feature, submit only one Zip formatted file (*.zip) named LastnameProject1.zip that includes the following files: - One source code file, Client-Project1.cpp. You do not need to include any other of your IDE project files. - A short summary of your work You are to use one of the Project Summary Document templates to start your summary. You are to fill-in the items at the top of the document and then place the answer to each of the four questions in the area below each of the questions. If you need/wish to include sample run(s) of your program, place it/them after the last question. Finally, Save as your document and then include it in your .zip submission file. Sample Run: The sample run on the next page must occur when your program is executed. You may supply a different Project Description if you wish. Sample Run: cS-300 Project \#1: Arithmetic Game This program will present a 2-addend arithmetic problem to the User. The answer will be solicited and the status of the guess provided. The User is then allowed to play the game again. 68 +50 - Your answer: 118 Correct! Play the game again ('y'): y 93 +24 - Your answer: 119 Your Sorry, the answer is: 117 Play the game again (' y ') : n Press only the 'Enter' key to exit program

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_2

Step: 3

blur-text-image_3

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago