Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your friend is starting a new business. She's gotten access to discounts all over town from stores, restaurants, and more. She's been selling her discounts

image text in transcribed
Your friend is starting a new business. She's gotten access to discounts all over town from stores, restaurants, and more. She's been selling her discounts to students but is having trouble keeping tabs on who owes her money. She's offered you a 20% cut of her total revenue to build a program that will track each student she sells to, the sale price of each item, and the amount of money she's collected from that person. Your program will read information from an input from a file that stores information about every transaction you friend makes. You may assume that your roommate has no more than 100 customers and each customer is labeled 0 through 99. Your program will need to respond to three different commands: 1. Add a payment 2. Sell an item 3. Print messages for negative accounts For commands of types 1 and 2, your program should update the appropriate customer account. A command of type one adds value to the account and a command of type two subtracts value from an account. For commands of type 3, you should print out a message with the following format for each customer (in order of customer number) that has a negative account balance: Customer X, you owe $Y. Please pay immediately! where X is the account number and Y is the number of dollars owed (a positive amount) If all accounts are paid properly, then print out the single line: All accounts are paid up to date!!! These commands will come from an input file. Your friend is starting a new business. She's gotten access to discounts all over town from stores, restaurants, and more. She's been selling her discounts to students but is having trouble keeping tabs on who owes her money. She's offered you a 20% cut of her total revenue to build a program that will track each student she sells to, the sale price of each item, and the amount of money she's collected from that person. Your program will read information from an input from a file that stores information about every transaction you friend makes. You may assume that your roommate has no more than 100 customers and each customer is labeled 0 through 99. Your program will need to respond to three different commands: 1. Add a payment 2. Sell an item 3. Print messages for negative accounts For commands of types 1 and 2, your program should update the appropriate customer account. A command of type one adds value to the account and a command of type two subtracts value from an account. For commands of type 3, you should print out a message with the following format for each customer (in order of customer number) that has a negative account balance: Customer X, you owe $Y. Please pay immediately! where X is the account number and Y is the number of dollars owed (a positive amount) If all accounts are paid properly, then print out the single line: All accounts are paid up to date!!! These commands will come from an input file

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago