Find Jobs
Hire Freelancers

Arrays and Arraylists : Frequency tables

$10-30 USD

Completed
Posted almost 8 years ago

$10-30 USD

Paid on delivery
1) use a single dimension array as a frequency counter, exception handling and methods in a Java application that will allow a user to input the miles driven and gallons used for and arbitrary number of trips. Your program will calculate and display the miles per gallon obtained for each trip and print in floating-point results. Test your exception handling by entering a trip while driving a Kia. The method main should Prompt the user for the manufacturer name of the car. They should enter a “1” for Honda, “2” for Toyota,”3” for Ford, “4” for a Chevrolet or a “5” for a Kia for each trip. Declare an array of size 5 as a frequency counter (do this exactly as I have stated because we want to check our exception handling code). Call a method that will prompt the user to enter the miles driven, gallons used, calculate the miles per gallon, display how many miles per gallon this type of car got on this trip. This method then passes back a “1” to add to the frequency counter for each type of car. If the car is a Honda, add a “1” to arrayname[1], if the car is a Toyota, add a “1” to arrayname[2], etc. Use exception handling with a try/catch block to catch an ArrayIndexOutOfBoundsException. Make sure that division by zero will not take place. Check that user input is a non-negative number and allow only positive numbers to be input. If the user has made an error in their input, prompt them again to enter a valid number. Be descriptive so they know what they did wrong when they typed in their number. -i already did most of it although it's not pretty bc its first time programming, however i just need help with the arrays 2) create: use a multidimensional array as a frequency counter to keep track of an arbitrary number of car sales of each car and print the array of total car sales. Here is the 5X3 array that will be used as a frequency counter for car sales. Honda Civic Honda Accord Honda Odyssey Toyota Corolla Toyota Rav4 Toyota Camry Ford Fiesta Ford F-150 Ford Fusion Chevy Malibu Chevy Impala Chevy Cruze Kia Optima Kia Sorrento Kia Soul For example, if I sell a Toyota Rav4, the program should add 1 to the array element at position [1, 1]. Declare a two-dimensional array to fit the table above. Remember to correct the intentional error in the previous assignment so that you do not encounter an exception. Prompt the salesman for the manufacturer name and make of the car. With numbers, but you may use Strings if you’d like. Ex: Enter a “1” for Honda, “2” for Toyota,”3” for Ford, “4” for a Chevrolet or a “5” for a Kia. Next, have them enter a number for the model. Print the values in all of the elements of the array using for loops with a description of the car sales so that I can understand how many cars were sold of each type (without looking at the code). Check that user input is a non-negative number and allow only positive numbers to be input. If the user has made an error in their input, prompt them again to enter a valid number. Be descriptive so they know what they did wrong when they typed in their number.
Project ID: 10382983

About the project

13 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
String num[][]=new String[a][b]; if (num<0){}else{} just a sample of the [login to view URL] a professional software engineer .i can deliver this in quick [login to view URL] forward to hear from you,thanks
$20 USD in 2 days
5.0 (1 review)
0.6
0.6
13 freelancers are bidding on average $27 USD for this job
User Avatar
Hello. Looks like easy assignment
$26 USD in 1 day
4.9 (443 reviews)
6.4
6.4
User Avatar
Hello, i am expert in java/c/c++ and i can deliver any task in least time and least payments. The code will be well commented and well formatted for better understanding. I believe in long term relations so first check your work then release the payments. Pm me for further details. Thank You!
$30 USD in 1 day
5.0 (23 reviews)
4.1
4.1
User Avatar
Hello, i'm software engineer and expert java developer. I am very good in data structure and can do this project for you. Please message me in chat and discus details. Regards Usman Shery
$30 USD in 1 day
4.6 (13 reviews)
4.1
4.1
User Avatar
Hi I have 3+ experience in web development. I did many job like this. I have strong knowledge of Mysql, Oracle, Database Design and I have also strong knowledge in languages like Java, JSP, PHP, Javascript, Bootstrap CSS, Ajgular JS, HTML, CSS, JQuery etc .
$30 USD in 1 day
4.7 (6 reviews)
3.7
3.7
User Avatar
I have 4 years experience in java and i can start right now
$20 USD in 1 day
5.0 (7 reviews)
2.5
2.5
User Avatar
My name is Muhammad Shahzeb Ali. I am a Software Engineer. I have: 1. Extensive knowledge of Java, C++, HTML5, CSS, Bootstrap, PHP, SQL(MySql), Javascript, JQuery, Wordpress - I have built one large PHP+MySQL portal for alumni of university ase.classworks.info. - I do not like to do simple HTML coding, I prefer to use existing libraries for that 2. Experience building secure dynamic websites and infrastructure 3. Extreme attention to detail - Before doing any work I sit and described all details, interfaces and methods which are going to be developed. I like to have clear picture before doing the job 4. Ability to thoroughly test and deliver bug-free code - For the last 3 years all my projects were launched in time and after go live I received only small things that should be corrected. I check every logical part of code before sending it to QA. I proud the quality I supply to clients
$25 USD in 1 day
5.0 (2 reviews)
1.1
1.1
User Avatar
A proposal has not yet been provided
$20 USD in 1 day
5.0 (1 review)
0.6
0.6
User Avatar
Hi. i have experience in Java and I really want to do this work for you. It would be a great opportunity. Thank you.
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Moline, United States
5.0
1
Payment method verified
Member since Apr 4, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.