Prog 1: Print UIC
8/30 Addition: Violating the rule about not using functions, arrays or strings will result in a 10 point penalty. Shown below in blue.
Write a program in the Codio programming environment that allows you to print the letters U I C as block characters made using asterisks. Running the program and choosing option 1 should look like:
Go Flames! Choose from among the following options: 1. Display U I C as horizontal block letters 2. Display U I C as vertical block letters 3. Display U I C as an animation 4. Exit the program Your choice -> 1 ------------------------ * * **** * * * * ** * * * ** * * * ** * * * ** * * * **** * * ------------------------ Running the program and choosing option 2 should look like: Go Flames! Choose from among the following options: 1. Display U I C as horizontal block letters 2. Display U I C as vertical block letters 3. Display U I C as an animation 4. Exit the program Your choice -> 2 ------- * * * * * * * * * * * * **** ** ** ** ** **** * * * * * * * * ------- Running the program and choosing option 3 should look like the following. Clearing the screen between displays can only be appreciated when running the program from the command line. Go Flames! Choose from among the following options: 1. Display U I C as horizontal block letters 2. Display U I C as vertical block letters 3. Display U I C as an animation 4. Exit the program Your choice -> 3 Clear the screen between displays? (Y/N) -> n How many sets of letters? -> 5 How many blanks between letters (0..30)? -> 1 ------------------- * * **** * * * ** * * * ** * * * ** * * * ** * * * * **** * * ------------------- ------------------- **** * * ** * * * * ** * * * ** * * * ** * * * **** * * * * * ------------------- ------------------- * * * * **** * * ** * * * * ** * * * ** * * * ** * **** * * * ------------------- ------------------- * * * * * * **** * * * ** * * * ** * * * ** * * * ** * * **** ------------------- ------------------- * * **** * * * ** * * * ** * * * ** * * * ** * * * * **** * * ------------------- Running the program and again choosing option 3 could look like the following, where this time we increase the number of spaces between the letters, which has the effect of also increasing the length of the lines at the top and bottom. Go Flames! Choose from among the following options: 1. Display U I C as horizontal block letters 2. Display U I C as vertical block letters 3. Display U I C as an animation 4. Exit the program Your choice -> 3 Clear the screen between displays? (Y/N) -> n How many sets of letters? -> 4 How many blanks between letters (0..30)? -> 5 --------------------------- * * **** * * * ** * * * ** * * * ** * * * ** * * * * **** * * --------------------------- --------------------------- **** * * ** * * * * ** * * * ** * * * ** * * * **** * * * * * --------------------------- --------------------------- * * * * **** * * ** * * * * ** * * * ** * * * ** * **** * * * --------------------------- --------------------------- * * * * * * **** * * * ** * * * ** * * * ** * * * ** * * **** --------------------------- Running the program and choosing option 4 to exit should look like: Go Flames! Choose from among the following options: 1. Display U I C as horizontal block letters 2. Display U I C as vertical block letters 3. Display U I C as an animation 4. Exit the program Your choice -> 4
We may rerun all tests within Codio before grading your program, so you need to test your program to make sure your program can pass all the tests. See the executable version of the program within the Codio project for the definitive version of what it should look like.
What You Need to Know
Environment: How to use the codio.com environment to edit, compile and run a program.
If you haven't already done so, on the codio.com starting page select the "Join Class" option at the upper-right. You will be prompted to enter a class token, which is: miguel-basic Alternatively connect to the course using this link
Once you are in Codio, you should use the project called: Prog1: Print UIC
Within the Codio project described above you can run the solution by doing the following:
1. Select the Tools / Terminal menu option
2. Within the terminal window, type in: ./solution
C++ Language concepts needed are included in the sample code in file sample.cpp . The concepts you need are: simple input ( cin) and output (cout); Using char and int variables; Incrementing a variable; The assignment statement (=); How to compare variable values; Repeating a group of statements using some sort of loop; Choosing between alternatives using an if statement, including compound conditions; Clearing the screen (see the sample code).
Notes
Read the parts of our online Zybook that you need to use in this program.
See the Codio sample program sample.cpp which illustrates various programming concepts you need for this program.
For this first program you may not use concepts other than those listed on this page that we have not yet discussed in class. In particular you may not use functions, arrays, or string variables. Violating this rule will result in a 10 point deduction.
Make sure you read the syllabus regarding the grading criteria. Particularly on the first program, students tend to lose points for not documenting adequately, for not choosing meaningful variable names, and for not including the required header within their code. Make your program output look exactly as specified. That way we can give you a good grade.