Develop a menu driven console java program

Assignment Help JAVA Programming
Reference no: EM131115315

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: EM131115315

Questions Cloud

Project executive of monopolistically competitive firm : Hank Yoon is the economist in a competitive market. The market price is $35 per item. The total cost equation is C(Q) =10 +2Q+0.5Q^2, and MC = 2 + Q. What level of output of items should you produce in the short run? You are the project executive of ..
Briefly indicate the practical and conceptual reasons : Briefly indicate the practical and conceptual reasons for the conclusion reached by the FinancialAccounting Standards Board on accounting and reporting practices for research and development costs
What factors does standard & poor analyze : What factors does Standard & Poor's analyze in determining the credit rating it assigns to a sovereign government?
Provide at least two examples of crimes on the internet : Provide at least two examples of crimes on the Internet that were identified as crimes before the Internet existed. What has their impact been in an online environment?
Develop a menu driven console java program : Review the text p.933for the use of the printf method and using a format string -  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 ..
Describe and discuss an experience in your personal life : Discuss the cycle of oppression and common responses to oppression. Explain the meaning and implications of the statement "we are as strong as our weakest link." Describe and discuss an experience in your personal life that connects you to the topic(..
Find the per-unit voltage regulation : Find the per-unit voltage regulation when the transformer is supplying full load at 110 V and 0.9 lagging power factor.
Assume that aggregate production function : Assume that aggregate production function is given by: Determine the scale of production. Suppose capital is quadrupled, while effective labour is held constant. What would be the effect on output?
What does sustainable development mean to you : What does "sustainable development" mean to you? Give some examples of development that might occur in industrialized and in developing countries that are not sustainable. What changes here could improve sustainability in development?

Reviews

Write a Review

JAVA Programming Questions & Answers

  1 gqueuea queue is an ordered collection of items in which

1 gqueuea queue is an ordered collection of items in which the removal of items is restricted to the fifo rst in rst

  Ask the user to enter a positive non-zero integer value.

Write a program which aske the user to Enter a positve non-zero integer value. if the value enterd zero or negative print as error message and end the program; otherwise, use the integer to call a method displayPattern(n) which must display the follo..

  Design a java application to read a file containing data

Design a Java application that will read a file containing data related to the passengers on the Titanic. The description of the file is shown below. The application should provide statistical results on the passengers including

  Number of primes

Write a program BackwardPrimes.java that prompts user for a positive integer number x and displays x prime numbers whose reversal is also a prime. Numbers 13, 31 and 157 are instances of such numbers. Following is a sample run of your program.

  Calculate rental fee for different types of borrowable media

Assume that there is an abstract class called Vehicle, which has two concrete subclasses, Car and Truck. There is also an interface Loadable, which only Truck implements - calculate a rental fee for different types of borrowable media (e.g. books,..

  Write a scanner that translates logical expressions

Write a scanner that translates logical expressions. There are many different notations for logical expressions.

  You need to train for 10 weeks

You are preparing for a marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10.

  Calculate the new date by adding a fixed number of days

What I have done is the "ExtendedDate.java", which improved the "data.java" that the program will firstly check if the date input from users is valid then store it with the setDate method.

  Development of database systems

Prior to the development of database systems, file I/O was how information was stored and retrieved. Give your opinion on what you believe we have gained by using databases. Explain whether or not you believe files had any advantages.

  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'.

  Design an application to take and process a pizza order

Design an application to take and process a pizza order. The user should be able to make pizza order choices from list boxes, and the application should display the order price.

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