Find Jobs
Hire Freelancers

Arrays and Arraylists : Frequency tables

$10-30 USD

完了済み
投稿日: 約8年前

$10-30 USD

完了時にお支払い
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.
プロジェクト ID: 10382983

プロジェクトについて

13個の提案
リモートプロジェクト
アクティブ 8年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
アワード者:
ユーザーアバター
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 2日以内
5.0 (1 レビュー)
0.6
0.6
この仕事に13人のフリーランサーが、平均$27 USDで入札しています
ユーザーアバター
Hello. Looks like easy assignment
$26 USD 1日以内
4.9 (443 レビュー)
6.4
6.4
ユーザーアバター
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 1日以内
5.0 (23 レビュー)
4.1
4.1
ユーザーアバター
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 1日以内
4.6 (13 レビュー)
4.1
4.1
ユーザーアバター
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 1日以内
4.7 (6 レビュー)
3.7
3.7
ユーザーアバター
I have 4 years experience in java and i can start right now
$20 USD 1日以内
5.0 (7 レビュー)
2.5
2.5
ユーザーアバター
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 1日以内
5.0 (2 レビュー)
1.1
1.1
ユーザーアバター
A proposal has not yet been provided
$20 USD 1日以内
5.0 (1 レビュー)
0.6
0.6
ユーザーアバター
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 1日以内
0.0 (0 レビュー)
0.0
0.0

クライアントについて

UNITED STATESのフラグ
Moline, United States
5.0
1
お支払い方法確認済み
メンバー登録日:4月 4, 2016

クライアント確認

ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。