Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If someone could help me with the code for this, Id appreciate it. If you could break it into steps with comments that would be

If someone could help me with the code for this, Id appreciate it. If you could break it into steps with comments that would be most helpful, like starting with the top half of the diamond then the bottom half. If you could provide comments Id appreciate that as well. Ill be listing the assignment with sample output as well as requirements. Thank you!!
image text in transcribed
image text in transcribed
image text in transcribed
Guidelines:
image text in transcribed
1. Overview The purpose of this assignment is to give you some experience with several programming concepts. The C concepts that this program will give you experience with include: using loops &conditionals, as well as printf & scanf, declaring variables, and using logical expressions. Also, this project is an exercise in time management and planning (i.e. writing algorithms) as much as it is an exercise in C programming. One of the most important lessons with programming is learning how to do things incrementally breaking up a big program into smaller components and working on each component one at a time. Suggested phases are outlined below. For this assignment, you will write a program that prints to the screen a character diamond, beginning with a character entered by the user, consisting of the number of rows also entered by the user. The number of rows will be constrained according to the width of the screen as well as end of the ASCII table. The first phase is to get the top half of the diamond working. The second phase will be to add the bottom half of the diamond to the output. The third and final phase will be to take care of errant input and fringe cases, i.e. to force the user to enter an allowable number of rows depending on both the width of the screen (assumed to be 80) and where in 3. Sample Output of Finished Program Sample output of the finished program is shown below. For this first phase, you should work on getting just the top half of the diamond working. Start with an algorithm first before haphazardly throwing down code. If your logic is wll thought out, transcribing your pseudo code from your algorithm into C code will more likely result in code that works or is close to working than if you skip this step. SAMPLE RUN #1: This program will print a character diamond Enter a character: 6 Enter an odd number at least 1 but less than 40: 15 67876 789:9876 789:8?:9876 6789:37ABA?<::9876 aba sample run this program will print a character diamond enter character: an odd number at least but less than phase iil: errant input and fringe cases for third final you should test your that already have with the assumption whoever runs may invalid example even of rows or outside allowable range. also consider cases-what happens if entered is towards end ascii table x do characters after by user then range can be printed reduced. as shown in second output below enters there are only four more printable z so highest could thus resulting new numbers being between handle example. one case not need to worry about handling where instead rows. always start algorithm first before haphazardly throwing down code. logic well thought out transcribing pseudo code from into c likely result works close working skip step leastl least1>??9876 6789: ;?@ABA@?>= ?@ABCDCBA@ ? >s( ; :9876 6789: ; ?@ABA@?>=<. :9876>??:9876 6789: ; =

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions