Process: 1. Write a method to ask the user for the number of candidates and return the value. Make sure the user enters

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Process: 1. Write a method to ask the user for the number of candidates and return the value. Make sure the user enters

Post by answerhappygod »

Process 1 Write A Method To Ask The User For The Number Of Candidates And Return The Value Make Sure The User Enters 1
Process 1 Write A Method To Ask The User For The Number Of Candidates And Return The Value Make Sure The User Enters 1 (200.74 KiB) Viewed 32 times
Process 1 Write A Method To Ask The User For The Number Of Candidates And Return The Value Make Sure The User Enters 2
Process 1 Write A Method To Ask The User For The Number Of Candidates And Return The Value Make Sure The User Enters 2 (84.44 KiB) Viewed 32 times
Process 1 Write A Method To Ask The User For The Number Of Candidates And Return The Value Make Sure The User Enters 3
Process 1 Write A Method To Ask The User For The Number Of Candidates And Return The Value Make Sure The User Enters 3 (71.65 KiB) Viewed 32 times
urgent java
Process: 1. Write a method to ask the user for the number of candidates and return the value. Make sure the user enters a number between 1 and 50 for number of candidates. 2. Write a method to ask for the last names of a series of candidates and the number of votes received by each candidate. The method must be able to pass the needed arrays. Note the method will have input statements. Hint: Array names are passed by reference. This function will not return a value. 3. Write a method to accept number of votes and number of candidates and return the percentage of votes. Hint: This function returns the array of percentage values. 4. Write a method to display each candidate's name, the number of votes received, and the percentage of the total votes received by the candidate in a tabular format. Note that this method does not calculate anything. It just displays data. Write a method to return the name of the loser. 5. 6. Write a method to return the average of the number of votes casted. 7. Write a method that accepts as parameter the name of a candidate and return the number of votes received by the candidate. If the given name does not exist, return -999, so you can use it in your main method to display an error message. Allow the user to search as many times as he or she wishes. The search must be case insensitive.
Do not use break or continue in your loops. Do not use global variables. Parameters must be passed to methods. The only global variable allowed would be the definition of the Scanner class, or in very specific situations as strictly required by the program requirements. o Choose descriptive method names. Avoid using method names such as methodl, method2, etc. Do not use System.exit() method
Show only 2 digits after the decimal point for the percentage of votes and the average votes. The number of votes must be a whole number. Display the number of votes without any digits after the decimal point. o Show the % symbol after the percentage of votes as shown in the sample run.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply