Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to calculate the price of a fruit gift basket A price file is a text file that contains one price per line

Write a program to calculate the price of a fruit gift basket
A price file is a text file that contains one price per line
The first line is the price for item 0(apples)
The second line is the price for item 1(oranges)
And so on
For example:
1.25
3.75
1.70
2.30
1.10
An order CSV file contains an item number and quantity on each line. For example,
1,3
2,1
0,1
Prompt the user for the price file and the order file
Calculate the price of the basket by summing each price multiplied by quantity
Print the total
Sample Run #1(bold, underlined text is what the user types):
Price file? prices.txt
Basket file? order.csv
Basket will cost $14.2
Test #1 checks all output
Mini Test #2 output includes Basket will cost $14.2
Sample Run #2(bold, underlined text is what the user types):
Price file? prices2.txt
Basket file? order2.csv
Basket will cost $21.25
Note: This is an introductory level class so no classes or too advanced programming. This programs requires the user to create a text file as well as a csv file while the program is running.

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions

Question

Develop clear policy statements.

Answered: 1 week ago

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago