Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

MIDTERM EXAM CS500 – SPRING 2021 –

Prof. Mavrides
You have until 10 pm to complete the exam. I expect you to
submit the code just as you have the previous assignments.
Please write your own code.
I understand commonalities, but I do not tolerate groups
submitting same code base.
As a former SHU CS student (and LEAD Software Quality
Assurance Engineer by trade) I will spot cheating a mile
away. Much safer to write it yourself.
1) - Write a program that asks users for their
birth month, day and year as integers. Output
back to the user the dates in reverse order and
then output the dates in the order they were
entered. Be sure to output dates in reverse
order first! Name the program Dates.

2) – Write a program that asks a user to enter


a number representing their favorite month.
For example, January is 1 and December is 12.
If the user enters December, January or
February output:
“I LIKE WINTER TOO!”
If the user enters March, April or May output:
“I LIKE SPRING TOO!”
If the user enters June, July or August output:
“I LIKE SUMMER TOO!”
If the user enters September, October or
November output:
“I LIKE FALL TOO!”
Name the program Favorites.
3) – There is a local coffee shop that has FOUR
free N95 masks that it gives away every day.
While there as still masks available ask user
how much they would like to donate. After all
FOUR masks are given away output the total
donations collected.
Name the program Masks.
Sample run:
OUTPUT: HERE IS YOUR MASK. HOW MUCH DONATION?

This study source was downloaded by 100000823820898 from CourseHero.com on 11-14-2022 11:38:20 GMT -06:00

https://www.coursehero.com/file/80760672/C-programsdocx/
10 <enter>
OUTPUT: HERE IS YOUR MASK. HOW MUCH DONATION PLEASE?
15 <enter>
OUTPUT: HERE IS YOUR MASK. HOW MUCH DONATION PLEASE?
7 <enter>
OUTPUT: HERE IS YOUR MASK. HOW MUCH DONATION PLEASE?
3 <enter>
OUTPUT: TOTAL DONATION 35 DOLLARS!

4) – Write a program that asks a user how


many children and adult tickets they want for
a movie. Adult tickets are $10 and children
$5. Pass the total price to a function that
calculates a twenty percent fee and returns it
to the main program. Add that fee to the total
and output the total including fee.
Name the program Tickets.

You have until 10 pm to complete the


exam.
I expect you to submit the code just as
you have the previous assignments.
Please write your own code.
I understand commonalities, but I DO
NOT tolerate groups submitting same
code base.
As a former SHU CS student (and
LEAD Software Quality Assurance
Engineer by trade) I will spot cheating
a mile away.

Much safer to write it yourself.

This study source was downloaded by 100000823820898 from CourseHero.com on 11-14-2022 11:38:20 GMT -06:00

https://www.coursehero.com/file/80760672/C-programsdocx/
Prof. M

This study source was downloaded by 100000823820898 from CourseHero.com on 11-14-2022 11:38:20 GMT -06:00

https://www.coursehero.com/file/80760672/C-programsdocx/
Powered by TCPDF (www.tcpdf.org)

You might also like