CENGAGE LOOPS.pdf a B 0800 54. Write a C program that can create four different patterns of different sizes. The size of each pattern is determined by the number of colum or rows. For example, a pattern of size 5 has 5 columns and 5 rows. Bada pattern is made of character $ and a digit, which shows the size. The siz must be between 2 and 9. Table 6-6 shows the four patterns in size 5. Pattern 1 Pattern 2 Pattern 3 Pattern 4 5$$$$ $$$$5 $$$$$ $$$$$ $5$$$ $$$5$ $$$$5 5$$$$ $$5$$ $$5$$ $$$55 55$$$ $$$5$ $5$$$ $$555 555$$ $$$$5 5$$$$ $5555 55559 TABLE 6-6 Patterns for Problem 54 Your program displays a menu and asks the user to choose a pattern and size. But note that it must be robust; it must prompt the user to choo an option only between 1 and 5, and a pattern size only between 2 and You are to print the menu and the user's response. The following examp shows all user menu responses, including potential errors ( responses are in color): MEN U 1. Pattern One 2. Pattern Two. 3. Pattern Three contin X,, S ܕܐ - ܕ NEERING lule), that can s applicable to is the on and s to press the obot is in its I and starts to e is triggered nation to the ess remote es throuhg her of the of the imn to be 5 right to ard. EMIO MARCON Wel 2 N Wa A WN 4. Pattern Four. 5. Quit Choose an Option (between 1 and 5): 11 Your Option is incorrect. Please try again. Choose an Option (between 1 and 5): 3 Choose a Pattern Size (between 2 and 9): 12 Your Pattern size is incorrect. Try again. Choose a Pattern Size (between 2 and 9): 4 LASERMO The program múst consist of a main function and six other functions called getoption, getSize, patternone, patternTwo, patternThree, and patternFour. tes the aver- Run your program once with the options and sizes shown in Table 6-7. Note that some options and sizes are missing because either the previous option or the size is invalid. s of different er of columns 5 rows. Each size. The size s in size 5. Option Size 1 SET 1 SET 2 SET 3 Pattern 4 $$$$$ SET 4 5$$$$ SET 5 55$$$ SET 5 555$$ SET 6. 5555$ SET 6 SET 7 ose a pattern and TABLE 6-7 Test Data for Problem 54 he user to choose between 2 and 9 following example ntial errors (use 3 4 6 5 3 Chapter 6 Repetition 387 2 2345 6 10 7 5 55. Write a C program to create a calendar for a year. The program reads the year from the keyboard. It then' calculates which day of the week (SUN, MON, TUE, WED, THU, FRI, SAT) is the first day of the year and prints the calendar for that year. After printing the year, it should ask if the user wants to continue. If the answer is yes, it will print the calendar for another year until the user is done. The program prompts the user for the input, as shown in the next example. Enter the year for your calendar 2000 SALATLAR Himnost

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

c structure

CENGAGE
LOOPS.pdf
a B
0800
54. Write a C program that can create four different patterns of different
sizes. The size of each pattern is determined by the number of colum
or rows. For example, a pattern of size 5 has 5 columns and 5 rows. Bada
pattern is made of character $ and a digit, which shows the size. The siz
must be between 2 and 9. Table 6-6 shows the four patterns in size 5.
Pattern 1
Pattern 2
Pattern 3
Pattern 4
5$$$$
$$$$5
$$$$$
$$$$$
$5$$$
$$$5$
$$$$5
5$$$$
$$5$$
$$5$$
$$$55
55$$$
$$$5$
$5$$$
$$555
555$$
$$$$5
5$$$$
$5555
55559
TABLE 6-6 Patterns for Problem 54
Your program displays a menu and asks the user to choose a pattern and
size. But note that it must be robust; it must prompt the user to choo
an option only between 1 and 5, and a pattern size only between 2 and
You are to print the menu and the user's response. The following examp
shows all user menu responses, including potential errors (
responses are in color):
MEN U
1. Pattern One
2. Pattern Two.
3. Pattern Three
contin
X,, S ܕܐ - ܕ
NEERING
lule), that can
s applicable to
is the on and
s to press the
obot is in its
I and starts to
e is triggered
nation to the
ess remote
es throuhg
her of the
of the
imn to be
5 right to
ard.
EMIO MARCON Wel
2
N Wa A WN
4.
Pattern Four.
5. Quit
Choose an Option (between 1 and 5): 11
Your Option is incorrect. Please try again.
Choose an Option (between 1 and 5): 3
Choose a Pattern Size (between 2 and 9): 12
Your Pattern size is incorrect. Try again.
Choose a Pattern Size (between 2 and 9): 4
LASERMO
The program múst consist of a main function and six other functions
called getoption, getSize, patternone, patternTwo, patternThree,
and patternFour.
tes the aver-
Run your program once with the options and sizes shown in Table 6-7.
Note that some options and sizes are missing because either the previous
option or the size is invalid.
s of different
er of columns
5 rows. Each
size. The size
s in size 5.
Option
Size
1
SET 1
SET 2
SET 3
Pattern 4
$$$$$
SET 4
5$$$$
SET 5
55$$$
SET 5
555$$
SET 6.
5555$
SET 6
SET 7
ose a pattern and TABLE 6-7 Test Data for Problem 54
he user to choose
between 2 and 9
following example
ntial errors (use
3
4
6
5
3
Chapter 6 Repetition 387
2
2345
6
10
7
5
55. Write a C program to create a calendar for a year. The program reads the
year from the keyboard. It then' calculates which day of the week (SUN,
MON, TUE, WED, THU, FRI, SAT) is the first day of the year and prints
the calendar for that year. After printing the year, it should ask if the user
wants to continue. If the answer is yes, it will print the calendar for
another year until the user is done.
The program prompts the user for the input, as shown in the next
example.
Enter the year for your calendar
2000
SALATLAR
Himnost
Transcribed Image Text:CENGAGE LOOPS.pdf a B 0800 54. Write a C program that can create four different patterns of different sizes. The size of each pattern is determined by the number of colum or rows. For example, a pattern of size 5 has 5 columns and 5 rows. Bada pattern is made of character $ and a digit, which shows the size. The siz must be between 2 and 9. Table 6-6 shows the four patterns in size 5. Pattern 1 Pattern 2 Pattern 3 Pattern 4 5$$$$ $$$$5 $$$$$ $$$$$ $5$$$ $$$5$ $$$$5 5$$$$ $$5$$ $$5$$ $$$55 55$$$ $$$5$ $5$$$ $$555 555$$ $$$$5 5$$$$ $5555 55559 TABLE 6-6 Patterns for Problem 54 Your program displays a menu and asks the user to choose a pattern and size. But note that it must be robust; it must prompt the user to choo an option only between 1 and 5, and a pattern size only between 2 and You are to print the menu and the user's response. The following examp shows all user menu responses, including potential errors ( responses are in color): MEN U 1. Pattern One 2. Pattern Two. 3. Pattern Three contin X,, S ܕܐ - ܕ NEERING lule), that can s applicable to is the on and s to press the obot is in its I and starts to e is triggered nation to the ess remote es throuhg her of the of the imn to be 5 right to ard. EMIO MARCON Wel 2 N Wa A WN 4. Pattern Four. 5. Quit Choose an Option (between 1 and 5): 11 Your Option is incorrect. Please try again. Choose an Option (between 1 and 5): 3 Choose a Pattern Size (between 2 and 9): 12 Your Pattern size is incorrect. Try again. Choose a Pattern Size (between 2 and 9): 4 LASERMO The program múst consist of a main function and six other functions called getoption, getSize, patternone, patternTwo, patternThree, and patternFour. tes the aver- Run your program once with the options and sizes shown in Table 6-7. Note that some options and sizes are missing because either the previous option or the size is invalid. s of different er of columns 5 rows. Each size. The size s in size 5. Option Size 1 SET 1 SET 2 SET 3 Pattern 4 $$$$$ SET 4 5$$$$ SET 5 55$$$ SET 5 555$$ SET 6. 5555$ SET 6 SET 7 ose a pattern and TABLE 6-7 Test Data for Problem 54 he user to choose between 2 and 9 following example ntial errors (use 3 4 6 5 3 Chapter 6 Repetition 387 2 2345 6 10 7 5 55. Write a C program to create a calendar for a year. The program reads the year from the keyboard. It then' calculates which day of the week (SUN, MON, TUE, WED, THU, FRI, SAT) is the first day of the year and prints the calendar for that year. After printing the year, it should ask if the user wants to continue. If the answer is yes, it will print the calendar for another year until the user is done. The program prompts the user for the input, as shown in the next example. Enter the year for your calendar 2000 SALATLAR Himnost
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY