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

  Write complete java program assuming that the variables gpa

Write a complete java program assuming that the variables gpa, studentName and deanList have been declared, you should read in the gpa and studentName from keyboard.

  Describe the applications functionality

Create an application for Koch's Cottages, a weekend getaway resort that rents cottages and boats to use on the local lake - Add labels as suitable to describe the application's functionality. Save the file as JCottageFrame.java.

  The objective is to implement a menu-based system

The objective is to implement a menu-based system for Bank Accounts in order to simulate a very simple banking system. Many structures have to be declared to manage bank accounts.

  How are java source code files named

What is the purpose of the wait(), notify(), and notifyAll() methods? How are Java source code files named?

  How to track password-cracking software

Imagine you are a digital forensic investigator for a healthcare organization. You learn from your internal information security department that an employee has been using password-cracking software to access confidential customer insurance inform..

  Write a small java application to read the file

Write a small Java program that uses the information you gained in part (a) to read the data in the database and print it to an output text file called accounts.txt

  This applet program needs an html file to run.

This applet program needs an html file to run. You should supply the file along with the program so that the reader can test it.

  Write a string expression that parenthesizes the value

Given a string varible word, write a string expression that parenthesizes the value of word. So if the word contains "sadly" the value of the expression would be the string "(sadly)".

  Illustrate how to create a bufferedinputstream

What are Buffered Input / Output Streams and why are they used - write some Java code to illustrate how to create a BufferedInputStream.

  Write a java application to display the following gui

Write a Java application to display the following GUI. At this point you are only implementing the display. We are not ready to make the calculator actually do any calculations

  How large a value can be stored in an integer variable

Most programming languages have a built-in integer data type. Normally this representation has a fixed size, thus placing a limit on how large a value can be stored in an integer variable

  Statement that creates and initializes a static variable

Write a statement that creates and initializes a static variable named salesTax to 7.59. Write a statement that creates a constant variable named TAX_RATE. The tax rate is 8.25%

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