Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment focuses on selection (switch, if, if/else) statement and computing a cumulative sum. The program prompts for today's date and the user's birthday. Each

image text in transcribed

This assignment focuses on selection (switch, if, if/else) statement and computing a cumulative sum. The program prompts for today's date and the user's birthday. Each prompt lists the range of values from which to choose. Notice that the range of days printed is based upon the number of days in the month the user typed. The program prints the "absolute day of the year" for today and the birthday. This is a date's place within the year from 1 to 365 . January 1 st is absolute day \#1 and December 31st is \#365. Lastly the program prints the number of days until the user's next birthday. Different messages appear if the birthday is today or tomorrow. The following are four runs of program and their expected output (user input is bold and underlined): Please enter today's date: What is the month (112)?7 What is the day (131) ? 2 7/24 is day #205 of 365 . Please enter your birthday: WhatisthemonthWhatistheday(112)?(130)?611 11/6 is day #310 of 365 . Your next birthday is in 105 days. Please enter today's date: What is the month (112)?9 What is the day (130) ? Z 9/22 is day #265 of 365. Please enter your birthday: What is the month (112)?3 What is the day (131) ? I7 3/17 is day #76 of 365 . Your next birthday is in 176 days. Please enter today's date: WhatisthemonthWhatistheday(112)?2(128)?I What is the day of (128) Please enter your birthday: What is the month (112)?2 What is the day (128) ? I5 2/15 is day \#46 of 365 . Wow, your birthday is tomorrow! Please enter today's date: 12/25 is day #359 of 365 . Please enter your birthday: What is the month (112)?12 What is the day 12/25 is day \#359 of 365 . Happy birthday

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago