Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this code is to have you writing basic C programs and to get used to using Makefiles. Deliverables: One sample C program

The purpose of this code is to have you writing basic C programs and to get used to using Makefiles.
Deliverables:
One sample C program for each of the following control structures:
if / else statement
while loop
for loop
do-while loop
switch statement
For each program (other than the switch statement), read in a number from the user (using scanf()) and then do something with the control statement. (i.e., read in a number, and then do the if/else with the number, printing something different based on the input). It isn't important what you do, but more important that you show you know how the control structure works by using the input from the user.
For the switch statement, read in a char (use getchar()) and then have a switch statement that prints out something based on the input. Having at least one "fall-though" case without a break. I suggest a case-inseneitive menu where you can enter an "A" or an "a" and have it run the same code, "B" or "b" to run some different code, etc. Make sure that it has a "default" at the end.
One Makefile with the following targets:
one target for each program (i.e. an "if" target, a "while" target) that generates a program of that name
one "all" target which generates all of the executables
one "clean" target which deletes all of the executables
Note: You don't need to generate a .o file with this Makefile, but if you do, make sure you delete the .o files when you run the "clean" target.
This assignment is not intended to be difficult, but just to have you write snippets of code to make sure that you understand how the code works.

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 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

LO2 Discuss important legal areas regarding safety and health.

Answered: 1 week ago