Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Files for Input and Output Write complete Java programs from the instructi

ID: 3560590 • Letter: U

Question

Using Files for Input and Output

Write complete Java programs from the instructions and output examples given.

1. a. Critical Thinking Exercise: Design a Java program that a small gift shop could use to order mer- chandise. The wholesaler requires that you send your order as a file over the Internet. Create your order file by entering your input through dialog boxes and writing to an output file named order.out. The order information that is output for each item consists of two lines: The first line contains the quantity of the item, a blank, the wholesale cost for that quantity of items, and an end-of-line character. The second line contains the description of the item and an end-of-line character. Design your program to ask for two different items to order. Write your design in the following space. Your design should be a list of Java comments without any code.

1. b. Write a Java program based on the design you created in Exercise 1a. Enter the program, saving it as Gifts1.java, and then execute the program. Follow your instructor

Explanation / Answer

/* * C program to display the inventory of items in a store / shop * The inventory maintains details such as name, price, quantity * and manufacturing date of each item. */ #include void main() { struct date { int day; int month; int year; }; struct details { char name[20]; int price; int code; int qty; struct date mfg; }; struct details item[50]; int n, i; printf("Enter number of items:"); scanf("%d", &n); fflush(stdin); for (i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote