Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write your code in Q30) that calculates how much money you will have after each day of spending (or saving). The user inputs the starting

image text in transcribed

Write your code in Q30) that calculates how much money you will have after each day of spending (or saving). The user inputs the starting (or target) amount of money (integer data type). Then In each day, the amount of money you spend (or save) is the same as the day number. The program lists out the spending (or saving) progress from day 0 until using up all the money (or reaching the saving target). 5th digit of Student ID Input $ Odd Original amount Even Saving target Calculate Spending Saving Sample display (for odd) Starting money: $6 Day 0 you spend $0 so you have $6 Day 1 you spend $1 so you have $5 Day 2 you spend $2 so you have $3 Day 3 you spend $3 so you have $0 Sample display (for even) Target money: $6 Day 0 you save $0 so you have $0 Day 1 you save $1 so you have $1 Day 2 you save $2 so you have $3 Day 3 you save $3 so you have $6 Sample display (for odd) Starting money: $20 Day 0 you spend $0 so you have $20 Day 1 you spend $1 so you have $19 Day 2 you spend $2 so you have $17 Day 3 you spend $3 so you have $14 Day 4 you spend $4 so you have $10 Day 5 you spend $5 so you have $5 Day 6 you spend $6 so you have $-1 Sample display (for even) Target money: $20 Day 0 you save $0 so you have $0 Day 1 you save $1 so you have $1 Day 2 you save $2 so you have $3 Day 3 you save $3 so you have $6 Day 4 you save $4 so you have $10 Day 5 you save $5 so you have $15 Day 6 you save $6 so you have $21

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

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

=+2 How does the preparation and support for each type of IE vary?

Answered: 1 week ago

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago