Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8. (4 marks) Create a java program for accepting the dealer details. The application should accept the dealer details such as name, address, phone

 

8. (4 marks) Create a java program for accepting the dealer details. The application should accept the dealer details such as name, address, phone number and services offered by the dealer. The dealer detail should be recorded in a file called dealerdetails.txt. This program should use a Serializable interface. The dealer detail will be hardcoded within the program and will not require user input via keyboard(scanner). The dealer details are shown within the program as shown in the program upon running it. Program output: Name: John Curtis Address: 84 Rose Street Springwood NSW 2777 Phone number: 0401566788 Services: Delivery REQUIREMENTS Application class: Implements Serializable It has 4 data fields - String name; String address; String phoneno; String services; . It has one constructor that takes 4 arguments, i.e., application (String name, String address, String phoneno, String services). It has print_details () that prints Name, Address, Phone number and Services on al separate line. Dealerdetail Inputs the hardcoded dealer details using a constructor application ("John Curtis", "84 Rose Street Springwood NSW 2777 ", "0401566788", "delivery") Write and save the dealer details into text file called dealerdetails.txt. Use FileInputStream, FileOutputStream, ObjectOutputStream and ObjectInputStream. Your code must work exactly the same as the specification with the program output as shown and should create a file called dealerdetails.txt in the program directory upon running it. Example of the program output: Name: John Curtis Address: 84 Rose Street Springwood NSW 2777 Phone number: 0401566788 Services: Delivery

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Applicationjava 1 2 3 4 5 7 9 10 11 12 13 14 15 249689872289 16 ... 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

Intermediate Accounting principles and analysis

Authors: Terry d. Warfield, jerry j. weygandt, Donald e. kieso

2nd Edition

471737933, 978-0471737933

More Books

Students also viewed these Finance questions

Question

Please help me evaluate this integral. 8 2 2 v - v

Answered: 1 week ago

Question

Please make it fast 8 2 1 . .

Answered: 1 week ago