Create a class named student that has three member variables

Assignment Help JAVA Programming
Reference no: EM13324944

StudentClass
Create a class named Student that has three member variables:

  • name - A string for the name of the student.
  • numClasses - An integer for how many courses the student is currently enrolled in.
  • classList - An array of strings for the names of the classes the student is enrolled in.

Write appropriate constructor(s), mutator (set), and accessor (get) methods for the class along with the following:

  • A function that inputs all values from the user, including the list of class names.
  • A function that outputs the name and list of all courses.
  • A function that r e s e t s the number of classes to 0 and the classList to an empty array

(with null strings).
The main() should test all of these functions. It should perform the following steps in a loop: • It should ask the user to input a student's data.

  • Display the entered data back (in a well-formatted way).

1

  • Ask the user if they want to enter the data again (y/n).
  • If 'n', then the program ends, otherwise it should clear the student class object and

repeat the loop (ask the user to enter new data...).
Note: The statement 'cin >> variable;' leaves a newline character in the buffer. This can be a problem if you are mixing 'cin >> variable;' and the 'getline' function (that reads a line of input). Use 'cin.ignore' function to discard the newline character after using 'cin'.
Filename: student.cpp
please write comments if possible and make simple if possible.

 

Reference no: EM13324944

Questions Cloud

Find the force of reaction between the blook and the box : a spring of stiffiness k supports a box of mass M in which is placed a blokk of mass m. find the force of reaction between the blook and the box
Difference btween deductive-inductive paragraph organization : In planning to write a document, what questions must a manager ask before putting words on paper? Should they all receive equal emphasis? What is the difference btween deductive and inductive paragraph organization? Give an example of each.
Community supported agriculture : Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegetables to your house once a week. For this programming project, define the class BoxOfProduce that c o n t a i n s exactly three bundles of fruits or vegetab..
Determine the width of the central bright fringe : Red light of wavelength 633nm from a helium-neon laser passes through a slit 0.370mm wide. What is the width of the central bright fringe
Create a class named student that has three member variables : Create a class named Student that has three member variables
Some disadvantages of using hackneyed phrases and jargon : Note several aspects of the context of managerial writing that make it unique. What are some of the advantages of short words over long words? Give examples of some recent obvious euphemisms used by people in advertising, public relations, or governm..
How high would he go : When jumping, a flea reaches a takeoff speed of 1.0m/s over a distance of 0.48mm. how high would he go
Explain moles of a monoprotic weak acid : The half-equivalence point of a titration occurs half way to the end point, where half of the analyte has reacted to form its conjugate, and the other half still remains unreacted. If 0.560 moles of a monoprotic weak acid
What are some advantages of written over oral communication : What are some advantages of written over oral communication? Breakdowns in the written process are less difficult to locate than are breakdowns in the oral process. Discuss this statement. Give an example of where two written messages on the same top..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name. Write a program that declares one Dog and one Cat, and assign names to them. Write two overloaded functions n..

  Java application that asks a user to enter two integers

Write a Java application that asks a user to enter two integers (A and B) and then display the results of A/B. Catch any division by zero errors and prompt the user to reenter the value of B. Be sure your code compiles and runs as expected. Name your..

  Recursive method

What will happen when the following recursive method is executed with an initial input value of 10?public int recursiveMethod(int input)

  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.

  Robot preparing for competition

Create an event so that the skateboard can be controlled by game player

  Write a java program that prints the numbers from 1 to 125

Write a Java Program that prints the numbers from 1 to 125. But for multiles of three print "Batman" instead of the number and for the multiples of five print "Superman". For instances which are multiples of both three and five "JusticeLeague".

  Create java program to find number of days left in that year

Create a Java program called "DaysLeftInYear.java" that outputs the number of days left in that year. use the calendar class to represent dates. Use the DateFormat class to display the current date in the output.

  Write a method called add uneven arrays

Write a method called addUnevenArrays that takes two arrays, a and b, and returns a new array, c, with alength that is the maximum of the lengths of a and b. Each c[i] is the sum of the corresponding elementsof a and b if both elements exist.

  standard graph with four quadrant

Write a program in java that asks the user for values of x and y, and displays the point as an ordered pair along with a message that describes where that point falls on the standard graph with four quadrant.

  Create the html form and call the servlet to print out

1. write a calculator Servlet that adds, subtract, multiples and divides. Create the html form and call the servlet to print out the answer

  Executing stringed musical instrument class

Create and execute a stringed musical instrument class.

  Display a welcome message to your user

Write a one screen description of your initial reactions to Java. Reactions may be both positive and negative. At the end of this module you will be asked to write a reply to these initial reactions.

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