Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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

Java, Programming

  • Category:- Java
  • Reference No.:- M91872892
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Java

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As