Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone please help me write this project in C, thanks. 2000 2000161501202010 1433202010 M a i Description: The purpose of this assignment is to

can someone please help me write this project in C, thanks. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
2000 2000161501202010 1433202010 M a i Description: The purpose of this assignment is to practice writing code that calls functions, and contains loops and branches. You will create a program that is m choices as input. The user will make choices regarding different plus (+) or X figures that will be printed to the screen de General Comments: This program will be graded using a script file. This means that for full credit, the specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Instructions: The source file for this assignment will be named lab3 username> // CS 262, Lab Section // Lab 3 Your code must contain at least one of all of the following control types: nested for loops . a while() or a do-while loop a switch statement an if-else statement five functions (in addition to the main function) T h e end with a menu driven program? How many Consider which control structures will work best for various aspects of the assignment. (Hint: What control type can be used with a menu driven program? How many statements should a case for a switch statement contain? Where would nested loops be appropriate for this program?) The first thing your program will do is print a menu of choices for the user. You may choose your own version of the wording or order of choices presented, but each choice given in the menu must match the following: Menu Choice Enter Change Character Enter Change Number Print Plus (+) Figure Print X Figure Quit Program Valid User Input Choices 'C' or 'e' Nor'n' 1 2 Oor 'q' A prompt is presented to the user to enter a choice from the menu. If the user enters a choice that is not a valid input, a message stating the choice is invalid is displayed and the menu is displayed again. Your executable file will be named lab3 username> Your program must have at least five functions (not including main() including: A function that prints the menu of choices for the user, prompts the user to enter a choice and retrieves that choice. The return value of this function must be paid. It will have one pass-by-reference parameter of type char. On the function's retum, this parameter will contain the user's entry, which is then used to determine the next action performed by the program. This function should allow the user to enter any value. In other words, it will not check for proper input. It will store the user input in the pass- by-reference variable and return, even if the input is not a valid menu choice. A function that prompts the user to enter a single character. The return value of the function must be of type char and will return the character value entered by the This retum value will be stored in a local variable, for whatever variable name you choose in main). The initial default value of this character will be blanker space character). A function that prompts the user to enter a odd number between 3 and 15 (inclusive). If the user enters an even number or a value outside this range the user is prompted to re-enter a value until a proper value is entered. The return value of the function must be of type int and will return the value entered by the user. This return value will be stored in a local variable, N (or whatever variable name you choose), in main(). The initial default value of this integer will be 0. Two "Print Figure" functions. Each function will take the current integer value and character value as input parameters. The return values of these functions will be void. The functions will print figures of N lines and columns using the input character The Plus function will print the figure as a plus () sign. The X Function will print the figure as a X. For example, if the integer value N-5. and the character value and the X function is called the following figure will be printed If the Plus function is to called, then the following figure is printed uch your program will still call the functions to E C .mymasonportalu .edu/bbcswebdav/ p 100 d-content / Note that if the user attempts to print the figure before entering any values for Cor N (or whatever variable name you choose), your program will still call the functions to print the figure. However, if N-(the default value the function will print a figure with no lines or columns (ie nothing). If the default), the function will print a figure with N lines or columns, but since is the blank character, no figure will be seen Suggested Steps to Complete the Assignment: You are not required to complete the following steps to write your program or even pay attention to them. However, following the steps will likely help you complete the lab faster and with fewer debugging issues. If you do use the suggested steps, you should test your program thoroughly to ensure each step works correctly before moving on to the next step 1. Create a directory named "Lab username>

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

=+ How about one you felt had acted in a hypocritical way?

Answered: 1 week ago