Hi I need help with my chapter 8 lab activities. There are 1 lab activities in each unit. Please do them and make sure I get 10/10 on them.
It’s Chapter 8
Username Leom77706@gmail.com
Password: Marvee@2003
https://learn.zybooks.com/zybook/GROSSMONTCSIS165N..
Category: Java
Question 2 In the metric system, what does the prefix “giga” mean? Group of ans
Question 2
In the metric system, what does the prefix “giga” mean?
Group of answer choicesThousandMillion
Billion
Trillion
PreviousNext
The a-s-s-e-s-s-m-e-n-t will write a Java program to obtain the following inform
The a-s-s-e-s-s-m-e-n-t will
write a Java program to obtain the following information from the user:
whether or not the user wishes to see the names of all suburbs/towns within a postcode (with a default that they just wish to see the name of the first suburb/town which matches);
the least postcode to be included in the output (with a default of the first valid Tasmanian postcode); and
the greatest postcode to be included in the output (with a default of the last valid Tasmanian postcode)
Please see the questions shown in the screenshot. I will send you all the info after being hired, eg PPTs, student access etc. Please send a draft in 12hrs -1 day time, day 2, and day 3 as well. + Will need to draft some questions to ask the teacher and revise base on feedback (Send bk ard in 1 day max)
Assignment Input Data File Your program will read from an input file: data.txt Y
Assignment
Input Data File
Your program will read from an input file: data.txt
You’ll need to select the data and copy it to an open text file (such as open with NotePad or Word). save as plain text. .
input file has a number of data items stored in the the following order:
Global data is on the first line, as this applies to all classes. This first line holds the weights to use for all classes, in this order: program weight, midterm weight, and final exam weight.
Every other line in the file is specific to a class, and so the next line starts with a course identifier (142, 143, or 263, and this is an int).
After the course identifier, a set of lines belonging to that course are listed, each with a student ID (four digits, such as 1234), an unweighted program score, an unweighted midterm score, and an unweighted final score.
Reaching a 0 indicates the end of input for a specific class, or the end of file if all class data has been consumed.
Note that the courseData.txt file terminates with a newline character after the final zero. This means that hasNextLine will test true even after that final zero is read.
Given this data file, your program should:
Be well-documented with comments.
Read in weights, IDs, course numbers, programs scores, midterm scores, and final scores per student from the sample input file provided (using Scanner).
Calculate statistics per student and per class and report the following:Output a weighted average per student.
Output a Pass/Fail mark per student.
Output an average per class
There should be at least one method that you write that can be used to provide output for tracing variables:The method should be called test-something, e.g., testStatistics.
Somewhere in your program, there should be a call to that method. In the code you submit, that call should be commented out.
Description and Example of Program Execution
This assignment is to write a class averaging program that outputs a summary of classes and students, given the above input data. For a high-level view, look at the sample program execution below. (The report goes to the console.)
Grade Data For Class 142
ID Programs Midterm Final Weighted Average Programs grade
— ——– ——- —– —————- ————–
3333 70 60 50 59.00 Pass
4444 50 50 50 50.00 Fail
5555 80 90 80 83.00 Pass
Class Average: 64.00
Grade Data For Class 143
ID Programs Midterm Final Weighted Average Programs grade
— ——– ——- —– —————- ————–
1212 90 85 92 … Pass
6666 60 80 90 … Fail
7777 90 90 90 … Pass
8888 95 87 93 … Pass
9999 75 77 73 … Pass
Class Average: …
Grade Data For Class 263
ID Programs Midterm Final Weighted Average Programs grade
— ——– ——- —– —————- ————–
2222 . . .
8989 . . .
9090 . . .
Class Average: …
The ellipses refer to calculated values, not included in the above example but which your program should calculate.
The columns “Programs”, “Midterm”, and “Final” in the output above (i.e., from the file) are raw scores (not weighted). The only calculation that involves manipulation of weights and grades is the weighted average. The Weighted Average is calculated using the following sum of products:
(programsWeight*programsGrade) + (midtermWeight*midtermGrade) + (finalWeight*finalGrade)
The Pass/Fail determination is made based only on the raw score of the students programs. If the student’s programs score is greater than or equal to 70, they pass. If less than 70, they fail.
Finally, the real data may differ from the sample data with respect to actual scores, but will not vary with respect to file format. Meaning that the program should work with multiple files formatted in the same fashion, and not just with the values in the sample file.
Example Code Skeleton
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.IOException;
public class xxx
{
//… class constants go here …
public static void main(String[] args)
{
Scanner inputFile = null; // File containing data (p. 297
// in Savitch discusses null)
// … code assigning inputFile in a try/catch statement
// … code for any stuff you need to do one time …
//Per class, print a table of ID numbers, grades, weighted average
// per student, and a Pass or Fail programs grade. The class
// average is also printed.
while (…) // be careful with hasNextLine() method
{
// Read class number, print class number title, headings.
courseNumber = inputFile.nextInt();
… rest of the code goes here …
// initialization
… code goes here …
// Loop to handle one class:
// For each student in the class, get and print their
// information, compute their avg, and sum the avgs.
while (…)
{
… code goes here …
}
// compute and print class average
… code goes here …
}
}
use something different, if needed. use nested loops, only one loop, and other methods.
txt file (add applicable commas or delimiters but leave structure as is)
0.30 0.30 0.40
550
1111 80 55 59
2222 50 70 60
3333 91 87 83
0
605
0345 95 83 98
3213 61 91 79
4456 91 95 89
1113 91 80 99
0709 72 70 73
0
765
2020 50 72 89
3030 90 55 75
4040 90 90 75
9090 35 45 65
0
Question # 1: Employee Class Write a class named Employee that has the following
Question # 1: Employee Class
Write a class named Employee that has the following fields:
name. The name field references a String object that holds the employee’s name.
idNumber. The idNumber is an int variable that holds the employee’s ID number.
department. The department field references a String object that holds the name of
the department where the employee works.
position. The position field references a String object that holds the employee’s
job title.
The class should have the following constructors:
A constructor that accepts the following values as arguments and assigns them to the
appropriate fields: employee’s name, employee’s ID number, department, and position.
A constructor that accepts the following values as arguments and assigns them to the
appropriate fields: employee’s name and ID number. The department and position
fields should be assigned an empty string (“”).
A no-arg constructor that assigns empty strings (“”) to the name, department, and
position fields, and 0 to the idNumber field.
Write appropriate mutator methods that store values in these fields and accessor methods
that return the values in these fields. Once you have written the class, write a separate program
that creates three Employee objects to hold the following data:
Name ID Number Department Position
Susan Meyers 47899 Accounting Vice President
Mark Jones 39119 IT Programmer
Joy Rogers 81774 Manufacturing Engineer
The program should store this data in the three objects and then display the data for each
employee on the screen.
Question # 2: Days in a Month
Write a class named MonthDays. The class’s constructor should accept two arguments:
An integer for the month (1 = January, 2 = February, etc.).
An integer for the year
The class should have a method named getNumberOfDays that returns the number of days
in the specified month. The method should use the following criteria to identify leap years:
1. Determine whether the year is divisible by 100. If it is, then it is a leap year if and if
only it is divisible by 400. For example, 2000 is a leap year but 2100 is not.
2. If the year is not divisible by 100, then it is a leap year if and if only it is divisible by
4. For example, 2008 is a leap year but 2009 is not.
Demonstrate the class in a program that asks the user to enter the month (letting the user
enter an integer in the range of 1 through 12) and the year. The program should then display
the number of days in that month. Here is a sample run of the program:
Enter a month (1-12): 2 [Enter]
Enter a year: 2008 [Enter]
29 days
For each of the above questions, please submit the
Submit your java code (.java files) – You can either zip them all up or submit them individually
Take a screenshot of the file’s code and output, put it in a Word document with your name on it
Question # 1: showChar Method Write a method named showChar. The method should a
Question # 1: showChar Method
Write a method named showChar. The method should accept two arguments: a reference to
a String object and an integer. The integer argument is a character position within the
String, with the first character being at position 0. When the method executes, it should
display the character at that character position. Here is an example of a call to the method:
showChar(“New York”, 2);
In this call, the method will display the character w because it is in position 2. Demonstrate
the method in a complete program.
Question # 2: Test Average and Grade
Write a program that asks the user to enter five test scores. The program should display
a letter grade for each score and the average test score. Write the following methods in
the program:
calcAverage—This method should accept five test scores as arguments and return the
average of the scores.
determineGrade—This method should accept a test score as an argument and return a
letter grade for the score, based on the following grading scale:
Score Letter Grade
90–100 A
80–89 B
70–79 C
60–69 D
Below 60 F
Submit your java code (.java files) – You can either zip them all up or submit them individually
Take a screenshot of the file’s code and output, put it in a Word document with your name on it