Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c language Write a program that uses repetition and switch statements to print the seven days of the week: Declare DAY = 1 Declare

in c language

Write a program that uses repetition and switch statements to print the seven days of the week:

  1. Declare DAY = 1
  2. Declare CHOICE = 1
  3. do {
    1. Use a switch statement to print the name of the day corresponding to the value of DAY
    2. Increase DAY by 1
    3. Ask the user to enter 1 if they want to keep seeing the days, or 0 if they want to stop.
    4. Take the user's input and store it in CHOICE
    5. If CHOICE is any value that isn't 0 or 1, the program should enter a loop to keep asking the user until they enter a valid value.
    6. If CHOICE is 0, use a break statement to exit the loop.
    7. If CHOICE is 1, use a continue statement to go back to the beginning of the loop.
  4. } while DAY < 8

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

???? Improve your approach to freeresponse macroeconomics questions

Answered: 1 week ago