Create a java class called student

Assignment Help JAVA Programming
Reference no: EM13754886

Create a Java class called student with the following instance variables:

• private String studentName;
• private int [] grades; //an array of grades

Include setter and getter methods to set and get these 2 properties. The setter method for the grades instance array variable - setGrades() - should take a single argument which is an array of int with the grades already filled in. setGrades() should be used if statement(s) to make sure that each grade value in the array parameter is valid (between 0 and 100) - you will need to use a loop in conjunction with the if-statement(s) to do this efficiently. If a grade is out of bounds,setGrades() should set that grade value to 0. The array that you pass to setGrades() must hold between 3 and 5 grades.

Include a method called outputGrade() that averages up all the grades in the student grades array and then uses a switch statement to output grade conversions based on the following criteria:

• For values from 0-59, your program should output: "Student has failed this class"
• For values from 60-69, your program should output: "Student gets a D"
• For values from 70-79, your program should output: "Student gets a C"
• For values from 80-89, your program should output: "Student gets a B"
• For values from 90-100, your program should output: "Student gets an A"

Where "Student" is the actual name of the student.

Create a test class called TestStudent that instantiates 3 students and sets their names and grades and then calls outputGrade() for each student. For your 3 students, 1must have 3 grades, 1must have 4 grades, and 1must have 5 grades.This is so you will have 3 different array sizes to pass to setGrades(). Make sure that for 1 student,setGrades() is called with 1 grade value that is out of bounds (less than 0 or greater than 100).

Reference no: EM13754886

Questions Cloud

Government to become involved to protect consumers : Analyze the major barriers for entry and exit into the airline industry. Explain how each barrier can foster either monopoly or oligopoly. What barriers, if any, do you feel give rise to monopoly that will allow the government to become involved t..
Multinational financial management : Imagine that you work for a corporation that is doing very well in the domestic market. Compare and contrast the overall pros and cons of accessing global markets, and recommend whether or not the company should consider such expansion. Provide a ..
Net realizable value of the accounts receivable : After the accounts are adjusted at the end of the year, Accounts Receivable has a balance of $215,000, Uncollectible Accounts Expense has a balance of $17,500, and Allowance for Doubtful Accounts has a balance of $12,500. What is the net realizabl..
Summarizes the of macroeconomic analysis : Write a 750-word paper that summarizes the of macroeconomic analysis - history of your chosen ETF, in terms of U.S. dollars, by checking or entering the ETF call letters or ticker symbol in a financial search engine such as Yahoo! Finance.
Create a java class called student : Create a Java class called student with the following instance variables: private String studentName
Create a class called employee : Create a class called Employee that has the following attributes: Employee ID of type String, First name of type String, Last name of type String
The implied multiplier associated with the stimulus package : If we assume that this growth resulted from the ARRA stimulus package, what was the implied multiplier associated with the stimulus package?
Dimensions of the business culture in the selected country : Determine the major elements and dimensions of the business culture in the selected country - Determine how these elements and dimensions are integrated by local residents conducting business in the country.
Government support of technological innovation : Research and identify how the U.S. government supports innovative technology activities in companies. Discuss at least two government sponsored programs and explain the positive effects these programs have on technology innovation in the private s..

Reviews

Write a Review

JAVA Programming Questions & Answers

  You have to create a world class that contains a 2d array

you have to create a world class that contains a 2d array then create an abstract class called organism that contains

  Uses a loop to populate a one-dimensional array

Write the following program that creates and uses a loop to populate a one-dimensional array that holds the even numbers between 1 and 12; creates and uses a loop to populate a second one-dimensional array that holds the odd numbers between 1 and 12;..

  Reading in strings from a text file into an array

If I am reading in strings from a text file into an array, where do I place this file at so that CodeBlocks will find it?

  Implementation the two classes

Program Specifications: In the new implementation, the two classes, Student and Grades, are defined with the following operations/methods.

  Calculates the total annual compensation of a salesperson

Write a Java application using an Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson

  Write a java program that asks the user for his/her gender

According to researchers at Stanford Medical School, the ideal weight for a woman is found by multiplying her height in inches by 3.5 and subtracting 108.

  Describe the basic c syntax for creating a class comprise

explain the basic c syntax for creating a class. include an explanation of the private and public section of a class

  Write a program that plays a word game with the user

Write a program that plays a word game with the user. The program should ask the user to enter the following.

  Prepare factorial program in java

You need to prepare a Factorial Program in Java with stateless EJB concept- There must be three java files 1.Factorial.java 2.FactorialBean.java 3.FactorialHome.java Theses Three file must be in package named 'mypack'.

  The array at the index method

have an array, how do i remove an entry from the array at the index method?

  Write java dice program

write java dice program.

  Method to calculate all primes in the range [2..n]

One commonly used method to calculate all primes in the range [2..n] is to start with the number 2, mark it as prime, and mark all its multiples (excluding itself) as not prime. Then, we find the next smallest unmarked number, mark it as prime, and m..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd