Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Directions. Consider the following program requirements. Complete and test ONE function at a time. Do not write the complete program before testing - create a

image text in transcribed

Directions. Consider the following program requirements. Complete and test ONE function at a time. Do not write the complete program before testing - create a function main that calls one function; once that function is perfected; create and test your program with a second function completed and so on... Read the below steps before beginning your design so you know what the program will accomplish - this is not an overly functional program but it practices some needed skills. 1. Begin the program by calling a "welcome" function. (5 points) a. This function generates an opening screen that welcomes the user and b. explains (briefly) the purpose of the program and C. any directions you think the user needs 2. Next, call a function that asks the user to enter a series of positive numbers. (10 points) a. Validate the users input (assure that the input is positive). An error message is to be displayed if the user enters a negative number and you do not want to count it as a valid entry. (Section 5.3 in the text reviews a very common & useful input validation technique.) The program should not continue until a valid entry is entered. b. The user will enter a zero to signal they have no more data to input. This function returns the number of valid entries (the number of positive numbers entered). You have seen multiple resources dealing with functions that return a value - review them as needed. 3. Now, call a function that accepts the number of positive numbers entered by the user (from previous step) (5 points) a. This function will display a message stating, "10 or fewer positive numbers were entered" or "More than 10 positive numbers were entered". You have seen multiple resources dealing with functions that accept a value - review them as needed. 4. Call a "goodbye" function that displays your programming contact information (make up something). (5 points) Additional requirements: Include opening comments (function main) O Programmer's name o Description of the program's purpose o Date code was last modified Use good programming style o Indentation 0 Comments within your code to explain major steps in the program o Blank lines to keep the code readable No global variables - you must pass and return values using parameters - this is what professionals do! Test and debug your program one function at a time Directions. Consider the following program requirements. Complete and test ONE function at a time. Do not write the complete program before testing - create a function main that calls one function; once that function is perfected; create and test your program with a second function completed and so on... Read the below steps before beginning your design so you know what the program will accomplish - this is not an overly functional program but it practices some needed skills. 1. Begin the program by calling a "welcome" function. (5 points) a. This function generates an opening screen that welcomes the user and b. explains (briefly) the purpose of the program and C. any directions you think the user needs 2. Next, call a function that asks the user to enter a series of positive numbers. (10 points) a. Validate the users input (assure that the input is positive). An error message is to be displayed if the user enters a negative number and you do not want to count it as a valid entry. (Section 5.3 in the text reviews a very common & useful input validation technique.) The program should not continue until a valid entry is entered. b. The user will enter a zero to signal they have no more data to input. This function returns the number of valid entries (the number of positive numbers entered). You have seen multiple resources dealing with functions that return a value - review them as needed. 3. Now, call a function that accepts the number of positive numbers entered by the user (from previous step) (5 points) a. This function will display a message stating, "10 or fewer positive numbers were entered" or "More than 10 positive numbers were entered". You have seen multiple resources dealing with functions that accept a value - review them as needed. 4. Call a "goodbye" function that displays your programming contact information (make up something). (5 points) Additional requirements: Include opening comments (function main) O Programmer's name o Description of the program's purpose o Date code was last modified Use good programming style o Indentation 0 Comments within your code to explain major steps in the program o Blank lines to keep the code readable No global variables - you must pass and return values using parameters - this is what professionals do! Test and debug your program one function at a time

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

Mastering Real Time Analytics In Big Data A Comprehensive Guide For Everyone

Authors: Lennox Mark

1st Edition

B0CPTC9LY9, 979-8869045706

More Books

Students also viewed these Databases questions