Find Jobs
Hire Freelancers

Using Queues and HashMaps

$30-250 USD

Suoritettu
Julkaistu noin 7 vuotta sitten

$30-250 USD

Maksettu toimituksen yhteydessä
[login to view URL] a class named Student as follows. The class keeps track of the student’s homework grades. [login to view URL] instance (or member) private variables – name (String), homeworks (an integer array list). b.A single constructor with name as its argument. Also, initialize the homeworks array list. c. The public get and set methods for the name instance variable. d.A void addHomeworkGrade method which takes one argument – the new homework grade. e.A public computeAverage method which takes no arguments and returns a double showing the average homework grade for this student. f. Override the toString method to return the string representation of this object in the format “The <studentName>’s average grade is <the computed average>”. 2. In your YourNameAssignment5 class implement the following functionality in its main method. a. Declare and initialize an empty Queue of Student objects named studentQueue. b. Declare and initialize an empty HashMap named studentMap. The keys will be the names of the students and the entries in the map will be the corresponding student objects. c. Use the Scanner class to read the [login to view URL] file. The contents of the file are shown below. Create the [login to view URL] file in your project. d. Read the contents of the text file one line at a time using a loop. The program should work for any number of input lines. In this loop, 1. Invoke the processInputData method for each line read. This method returns the corresponding Student object. 2. Add this Student object to the studentQueue. 3. Insert this Student object into the studentMap using the student’s name as the key. e. After the loop is processed, do the following. 1. Iterate over the studentQueue and display each element to the console. 2. Access the keys of the studentMap and assign them to an appropriate variable. Create an iterator over the keys. Iterate over each key in this set and display the associated object in the map to the console. External to the main method but in the same class as the main, write a private method processInputData with return type Student which processes its string input argument and returns the corresponding Student object as follows. 1. Use the String class’s split() method to break up each line read in from the file based on a comma, “,”, to separate data. 2. Extract the name string. Create a Student object and pass name into the Student constructor. 3. Using a while loop, read the next homework grade and convert it to an integer. Use the addHomeworkGrade method on the student object to add the homework grade for this homework. 4. Display the string representation of the currentStudent object to the console. 5. The method should return the currentStudent object. Sample Input [login to view URL] file: Alice,44,79,85,72,77,57 Bob,79,94,70,71,71,51 Charlie,95,99,41,55,65,50 Dave,87,89,88,55,74,63 Ed,82,51,44,67,73,49
Projektin tunnus (ID): 13538580

Tietoa projektista

6 ehdotukset
Etäprojekti
Aktiivinen 7 vuotta sitten

Haluatko ansaita rahaa?

Freelancerin tarjouskilpailun edut

Aseta budjettisi ja aikataulu
Saa maksu työstäsi
Kuvaile ehdotustasi
Rekisteröinti ja töihin tarjoaminen on ilmaista
Myönnetty käyttäjälle:
Käyttäjän avatar
Too simple project for me to complete. Best services guaranteed. Best Java developers team in this site.
$70 USD 3 päivässä
4,9 (225 arvostelua)
6,6
6,6
6 freelancerit tarjoavat keskimäärin $156 USD tätä projektia
Käyttäjän avatar
Hello, My name is Tinh Nguyen. I have done many projects in Java for worldwide students and got many positive feedbacks from them. You can check my profile for more detail. http://freelancer.com/u/nani01029x.html Let me help you. I'm about to get started right away. Looking forward to your reply. Thanks and best regards, Tinh Nguyen
$30 USD 1 päivässä
5,0 (99 arvostelua)
5,6
5,6
Käyttäjän avatar
Hello Will help you perfectly to complete your java code as you describe. Regards Atiar Talukdar ..........................................
$250 USD 4 päivässä
5,0 (3 arvostelua)
4,3
4,3
Käyttäjän avatar
We r the best Java company in this site. We completed all the projects with 100% client satisfaction and perfection too.
$100 USD 3 päivässä
5,0 (21 arvostelua)
4,2
4,2
Käyttäjän avatar
Hello. A university teacher with more than 5-years in Programming Languages and OOP. I can do that in a few days. Let's talk :)
$333 USD 5 päivässä
5,0 (3 arvostelua)
2,5
2,5

Tietoja asiakkaasta

Maan UNITED STATES lippu
Grand Rapids, United States
5,0
2
Maksutapa vahvistettu
Liittynyt maalisk. 28, 2017

Asiakkaan vahvistus

Muita töitä tältä asiakkaalta

Dialog Box Based ATM
$30-250 USD
Kiitos! Olemme lähettäneet sinulle sähköpostitse linkin, jolla voit lunastaa ilmaisen krediittisi.
Jotain meni pieleen lähetettäessä sähköpostiasi. Yritä uudelleen.
Rekisteröitynyttä käyttäjää Ilmoitettua työtä yhteensä
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ladataan esikatselua
Lupa myönnetty Geolocation.
Kirjautumisistuntosi on vanhentunut ja sinut on kirjattu ulos. Kirjaudu uudelleen sisään.