Inked235345364566556546_LI.jpg
Sample output:

Enter number of guests: 40

40 guests have been invited.

Enjoy the party!

I need help with this question

Refer to the file cars_data.txt. It consists of a dataset of about 400 cars with 8 characteristics such as horsepower, acceleration,etc. The first line contains the different details that are stored in the file and the second line contains the data type for each information. As from the third line the actual values about the 8 characteristics are stored.

You are required to write a complete Java program that will:

(a) Create 8 parallel arrays to store 8 information pieces about the 400 cars or two-dimensional arrays, using the type provided in the second line, in the main() function

(b) Read the file cars_data.txt and fill the 8 arrays created in (a); you may use a function for that.

(c) Provide a menu to the user with following options:

  1. Search by car model (e.g. Toyota, Chevrolet, ...)
  2. Search by country of origin
  3. List car/s with maximum horsepower
  4. List car/s with maximum acceleration
  5. List car/s with minimum weight
  6. Exit
    The menu will run in a loop such that after running an option the menu will re-appear until user chooses to exit. You are required to write a function to implement options 1 to 5 and use a switch case construct.

(d) create a main function which will call the functions in (c)

A case where inheritance is obviously appropriate. You want a base class of Party from which BdayParty inherits. Different languges have differences in how to do object oriented design. C++ is straightforward but in Javascript I'd make a module for the BdayParty to use another module named Party internally if I was interested in other parties later. If it is a one-off program to solve a particular problem I'd not bother with inheritance and just make one class or module.

commented: Fail. Answer has zero relevance to the question. -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.