Create three classes the Calculation class, Conversion class and Menu Class.
The Conversion class should have the following methods.
double KMToMiles(double distance)
double MilesToKM(double distance)
double FeetToMetres(double distance)
double MetresToFeet(double distance)
double KgToPounds(double weight)
double PoundsToKg(double weight)
double CelciusToFahrenheit(double temperature)
double FahrenheightToCelcius(double temperature)
The Calculation class should have the following methods
int SumOfSeries(int start, int end, int incr)
int SumOfArray(int data[], int size)
int ProductOfSeries(int start, int end, int incr)
int ProductOfArray(int data[], int size)
e.g. SumOfSeries(10,20,2) should produce the answer 90
Hint : 10+12+14+16+18+20
Similary ProductOfSeries(100,200,50) should produce 3,000,000
Hint : 100x150x200 = 3,000,000

The Menu class should have the following methods
void displayMainMenu()
void displayConversionSubMenu()
void displayCalculationSubMenu()
void displayConversionLengthSubmenu()
void displayConversionWeightSubmenu()
void displayConversionTemperatureSubmenu()
The menu class methods should display the options available under each selected menu. e.g. The
displayCalculationSubMenu() method should display the following.
Calculation Sub Menu

  1. Sum of Series
  2. Sum of Array
  3. Product of Series
  4. Product of Array
  5. Exit
    If the user selects the sum of array option (option 2), your program should input the size of the array,
    get values to the array from the keyboard, create a Calculation type object and invoke the SumOfArray()
    method to calculate the sum of the Array element and to display it. After displaying the answer the
    same sub menu should be displayed. When the user selects Exit (option 0), you should exit from that
    sub menu.
rproffitt commented: Reads like homework or assignment. Show your work. Where did you get stuck? -3

Recommended Answers

All 5 Replies

Anyone have an answer for this question???

The question was never answered because a question was never asked. The OP just posted a homework assignment.

That's basically saying "Here's my homework. Do it for me." That never goes well.

commented: So How can I find the correct answer for this?? +0

You write a Java program as specified in the assignment. Have you even tried to start writing?

commented: yes +0

A tip - the comment tool is used for commenting on a post. Commenting does not cause the thread to be marked as having new content so it will likely not be read. Add a new post to the thread instead.

As for getting help with your code, if you've written some then post it here so we can have a look. Tell us where you are stuck.

Be a part of the DaniWeb community

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