The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 2 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Hello,
I need help with this homework. I have attached the instructions.
Â
Thank you1 Homework 6 – ISM 3230 Summer 2017 Due to Canvas: Monday, July 3rd 11:59pm Election FAU Student Government recently had elections for the new President for the 2017-2018 school year. You must write a program that allows the user to enter the candidates’ names and number of votes receives, calculates the total number of votes cast and the percentage of votes received by each candidate, and displays the candidates’ names, the number of votes received, and the percentage of votes received. Your program should prompt the user (customer) to enter the following information: ï‚· Candidates’ names ï‚· Number of votes received by each candidate The program then outputs the following information: ï‚· Candidates’ names ï‚· Number of votes received by each candidate ï‚· Percentage of votes received by each candidate ï‚· Total number of votes cast Please refer to the Sample Output file for full details of what the program should look like when it runs. Program requirements: 1. Your program MUST read all of the information about the candidates (names and votes received) BEFORE doing anything else in the program (e.g. calculating the total number of votes cast) 2. You MUST store the following information in three different arrays: candidates’ names; number of votes received by each candidate; percentage of votes received by each candidate. 3. Your program MUST include the following user-defined method, in addition to the main method: Calculate total number of votes cast in the election. ï‚· This method processes the array of votes received and returns the total number of votes cast (HINT: Pass the array as a parameter to this method) Possible high-level outline for the logic of your program (you do NOT have to follow these steps – this is just a suggestion): Loop to read the name of each candidate into an array and the number of votes received into an array Call method to calculate the total number of votes cast Loop to calculate the percentage of votes earned by each candidate Loop to print the candidates’ names, number of votes received, and percentage of votes received Print total votes cast NOTE: If your program sometimes skips the step where the user can enter the name of the candidate, use next() (not nextLine()). None of the candidates’ names will have spaces, so nextLine() is not needed. 2 This assignment MUST be created individually. You must turn in your OWN source code and Java bytecode executable file. You MAY NOT share files! Instructions ï‚· Compile and execute your program to ensure that it works correctly. ï‚· Be sure to run your final program using the sample data included in the Sample Output file to ensure your program works properly. ï‚· Make sure your output labels match those in the Sample Output file exactly. Notes ï‚· You MUST store any calculations in variables. ï‚· You do NOT need to worry about formatting the decimal places on values you calculate ï‚· You may perform the tasks in any order as long as your output follows the order of the output in the example scenarios contained in the Sample Output file ï‚· You must include the one user-defined method specified above. You may include additional methods if you want, but you MUST include at least this method in addition to main. ï‚· Do NOT use global variables unless you have a REALLY good reason for doing so. Extra credit (10 points) Determine the winner of the election, and print the winner to the screen. Please refer to the Sample Output – BONUS file for formatting details. You do not need special syntax to do this – you will have to think logically about how to solve this problem. To receive full credit: ï‚· Submit the following files in a single zip file to Canvas o File with your Java source code (.java file) o File with your Java bytecode executable file (.class file) o Refer to the instructions for creating the zip file on Canvas – if you do not create the file with the correct folders and structure, you will lose points ï‚§ Modules ïƒ NetBeans Information -> NetBeans -> where are my files for my hw? ï‚· You must follow the appropriate Coding Standards listed in the Coding Standards document under Modules on Canvas. o 40% of your grade on the source code will be based on how well you follow these standards and how well you comment your source code ï‚· Submit your zip file to Canvas using the Assignment submission feature by 11:59pm 7/3/2017. Instructions for submission are available on Canvas where you downloaded this file (Assignments --> Homework 6).
Attachments:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly