Develop a menu driven console java program

Assignment Help JAVA Programming
Reference no: EM13965220

Details

For this assignment, you are required to develop a Menu Driven Console Java Program to demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and built-in types, Java defined objects, arrays, selection and looping statements and various other Java commands. Your program must produce the correct results.

The code for the menu and option selection is supplied and is available on the course website, you must write the underlying code to implement the program. The menu selections are linked to appropriate methods in the given code. Please spend a bit of time looking at the given code to familiarise yourself with it and where you have to complete the code. You will need to write comments in the supplied code as well as your own additions.

What to submit for this assignment

The Java source code:
 o Mark.java
 o ProcessMarks.java
If you submit the source code with an incorrect name you will lose marks.

A report including an UML diagram of your Mark class, how long it took to create the whole program, any problems encountered and screen shots of the output produced. (Use Alt-PrtScrn to capture just the application window and you can paste it into your Word document) You should test every possibility in the program. You should also include a couple of screen shots of your participation in the weekly tutorial forums.

Assignment Specification

You have completed the console program for collecting statistics for the entry of student marks. We are going to extend this application so the student names and marks can be stored in an array of objects.

The program will run via a menu of options, the file ProcessMarks.java has been supplied (via the Moodle web site) which supplies the basic functionality of the menu system.

1015_Menu system.png

Look at the code supplied and trace the execution and you will see the menu is linked to blank methods (stubs) which you will implement the various choices in the menu.

Mark class
First step is to create a class called Mark (Mark.java).

The Mark class will be very simple it will contain two private instance variables:
o studentName as a String
o studentMark as an integer

The following public methods will have to be implemented:
o A default constructor
o A parameterised constructor
o Two set methods (mutators)
o Two get methods (accessors)

ProcessMarks class
Once the Mark class is implemented and fully tested we can now start to implement the functionality of the menu system.

Data structures
For this assignment we are going to store the student names and marks in an array of Mark objects. Declare an array of Mark objects as an instance variable of ProcessMarks class the array should hold twenty students.
We need another instance variable (integer) to keep track of the number of the student being entered and use this for the index into the array of Mark objects.

Menu options
1. Enter student name and mark: enterStudentMark()

For assignment two we are going to use the GUI dialog showInputDialog() for our input. You will need to create the following two dialogs to receive the input from the user. You will not implement the functionality of the cancel key (need to use exceptions for this).

1471_Menu system1.png

Data validation (you can implement this after you have got the basic functionality implemented) You will need to validate the user input using a validation loop.

The name cannot be blank i.e. not null and the mark needs to be between zero and one hundred (0- 100) inclusive.

Use the following pseudocode as a guide how to do this.

READ value
WHILE value is incorrect OUTPUT Error message READ value
END WHILE

Output the following error dialogs:

666_Menu system2.png

When the student name and mark has been entered successfully into two local variables you will need to add these values into the Mark object array, you will also need to increment a counter to keep track of the number of students you have entered and the position in the array of the next student to be entered.

When the maximum number of students is reached do not attempt to add any more students and give the following error message:

Error - maximum number of students to be entered has been reached

When the student details have been successfully entered display the details of the student on the console screen.

1892_Menu system4.png

If no students have been entered the following menu options should display the following message:

You must enter at least one student to display all marks

2. Display all student names and marks: displayAllMarks()

 When this option is selected display all of the students who have been entered so far.

Review the text p.933for the use of the printf method and using a format string. You could also use String.format() to format your output. Supplementary material to cover string formatting will be available in week 10.

3. Display statistics: displayStatistics()

When this option is selected you will display the statistics as per assignment one.

4. Search for student: searchStudent()

You can just use a simple linear search which will be case insensitive. Use the showInputDialog() method to input the name (you can share this functionality from enter student.

If the search is successful display the details about the student.

If the search is unsuccessful display an appropriate message.

Extra Hints

Your program should be well laid out, commented and uses appropriate and consistent names (camel notation) for all variables, methods and objects.

Make sure you have no repeated code (even writing headings in the output) Constants must be used for all numbers in your code.

Attachment:- JAVA.pdf

Reference no: EM13965220

Questions Cloud

Independent chi-square random variables : 1. Let X and Y be independent chi-square random variables with 14 and 5 degrees of freedom, respectively. Find
Problem regarding the chi-square distribution : 1. Let Y have a chi-square distribution with 7 degrees of freedom. Find the following probabilities.
Data: collect appropriate sample data for the ctq : Data: Collect appropriate sample data for the CTQ variable or attribute, as well as the sampling plan you have adopted. Depict your data in a tabular form.Analysis: Calculate SPC parameters, and construct the control chart(s) by plotting. Represent y..
Sixty healthy humans are selected at random : It is known that a healthy human body has an average temperature of 98.6?F, with a standard deviation of 0.95?F. Sixty healthy humans are selected at random. What is the probability that their temperatures average at least 99.1?F?
Develop a menu driven console java program : Develop a Menu Driven Console Java Program to demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and built-in types, Java defined objects, arrays, selection and looping statements and various other Java ..
Raw materials were issued for use in production : Raw materials were issued for use in production. Completed units were sold on account for $1,400,000. The cost of goods sold was $890,000.
Problem regarding the proportion of samples : A population of disk drives manufactured by a certain company runs with mean seek time of 10 milliseconds with standard deviation of 0.1 milliseconds. What proportion of samples of size 250 would you expect to result in a mean less than 9 millisec..
Conference board produces a consumer confidence index : The Conference Board produces a Consumer Confidence Index (CCI) that reflects people's feelings about general business conditions, employment opportunities, and their own income prospects. Some researchers may feel that consumer confidence is a funct..
Determining the proportion of measurement times : In order to evaluate a new release of a database management system, a database admin- istrator runs a benchmark program several times and measures the time to completion in seconds. Assuming that the distribution of times is normal with mean 95 se..

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Need a console program

Need a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed).

  Write a on the popularity of java

Write a 4-5-page research-oriented paper in APA format that focuses on the "Popularity of Java". The paper must cite at least 5 references, not including the textbook or the Bible.

  The bookstore wants you to make an object-oriented model

student bookstore at pleasant creek community college situation the bookstore staff at pleasant creek community college

  Create bean jsp program which will compute simple interest

Create the bean which will compute Simple Interest. Use bean in JSP program. Accept details of saving like principal amount, rate of interest, period-in years from user and show amount

  Advantages and disadvantages of a stringbuilder

What is the difference between string and StringBuilder? What are the advantages and disadvantages of a StringBuilder

  Javascript program that asks the use

Design a javascript program that asks the user for a username with at least eight characters, beginning with a letter and including at least one digit. Next, write a validation loop to ensure that these conditions have been met

  Write a program that displays a countdown first

Write a program that displays a countdown first, and then displays the position and velocity of an object for every second it drops, as long as it is above 500 feet

  Explain the tasks occur in exception handling

Calculate the letter grade the student has earned based on the average of these assignments.

  The comparedto method

the comparedTo method. This is the course class I do not understand how to do the compared to method. I need to order the course first by department then by the course number.

  Problem aa savings account object holds a nonnegative

problem aa savings account object holds a nonnegative balance and provides depositk and withdrawk methods where

  What is one example from the list in table of popular

based on the keston 2013 article what are the advantages and disadvantages of using mashups? what is one example from

  Marketing necessary for practice-hospital to successful

Why is marketing necessary for a practice or hospital to be successful? What considerations should be taken into account when marketing health care services or products? (Hint think about all the medication ads you seen on tv or in magazines)

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