Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Design Constraints

Your program should confirm to the following constraints.  It should:

  • include at least one example of the successful and appropriate use of :
    • a two-dimensional array containing numbers or characters
    • a switch statement
    • an if statement
    • a while-loop
    • a do-while loop
    • a for-loop
  • ensure that your program can handle invalid data which lies outside of a specified range e.g. number of competitors < 0 or a result of -5.  You can assume that the correct data type has been enteredie if you are expecting the user to enter data of type int that this will be the case.
  • use appropriate formatting and programming styles (ie naming, formatting and commenting of code)
  • successfully compiles in Eclipse without any warnings. 

You may add additional functionality to your program, however, you must necessarily complete the above requirements.

NOTE: Code that does not successfully compile will not be marked. In such cases, only the specification, design and question sections of the assignment will be awarded marks.  If you are unable to get your code to compile, please state this clearly in your submission and comment out the offending code prior to handing in your work.  Even if your code compiles but has warnings, marks will be deducted.

Part A - Code Comprehension

Sample code has been provided Moodle.  Use the sample code provided to answer the following questions:

1. When the program is first run and menu item 2 is selected what is displayed?  Why is the output displayed as it currently is?

2. Explain how the loop displaying the menu is exited, what value does menuSel have when the program finishes? Describe what happens next when menuSel gets this value.

3. The reserved word breakis used in the switch-statement to manage the menu selection.  What is the purpose of the breakstatement? 

4.  Currently, if the user enters an incorrect menu selection (such as 5) what happens?  How could the switch-statement be altered to allow for an error message to be displayed

5.  What alternative loop could have been used for the main controlling loop (i.e. the do-while)? 

6. Briefly explain the two lines of code that have been used to create the array to store the scores for each competitor.  In your explanation, provide a diagram to illustrate how the array is stored.

7.  The variable done is declared as a boolean.  Explain what would happen if the code in the do-while loop was changed to:

while(done=true);

8. Currently, menu item one prompts the user for data for Competitor 0 up to Competitor 4.  What change would you have to make to the code so that displays Competitor 1 to Competitor 5?

9. The design of the output in for menu selection 2 needs to be changed so that it displays the scores as per the following:

Competitor 1:        1      1      1      1      1

===============================================

Competitor 2:        2      2      2      2      2

===============================================

Competitor 3:        3      3      3      3      3

===============================================

Competitor 4:        4      4      4      4      4

===============================================

Competitor 5:        5      5      5      5      5

===============================================

Provide the changes to the code that you need to make to do this.

10.  Explain how the nested for-loop in menu item 2 could be altered so that the user could specify how many competitors and how many judges to use up to the maximum values?  For example, the maximum number of judges is 5 but the user of the program indicates that only 3 judges will be used for this competition.

If you have used any resources (books, websites, etc) you do need to cite and reference this material appropriately.

Part B- Program Requirements

The first part of the assignment is to provide the requirements of the program to be developed.  This should provide enough details so that another programmer would be able to design and implement the program. 

Your program should present the user with a menu that provides at least the following functionality:

  • Input the number of competitors, judges, students, players, attempts,etc
  • Input some form of data
  • View reports - at least two different reports (e.g. average result, average score)
  • Quit the system

Your requirements should allow your program to conform to the design constraints listed above.

You are required to check with your either your lecturer or tutor before continuing to ensure the problem you are considering is appropriate.

Part C- Analysis and Design

Design a program for the task you have specified in Part A. You should include:

  1. An analysis of the problem
  2. High level pseudo-code
  3. Test data

Once you have completed your pseudo-code perform a desk check. If you find any problems with your pseudo-code you should redesign and retest.  Details of any refinements that you have made to your algorithm and further testing that was conducted should be included in your design.

Part D - Implementation and Development

Using design developed in Part B implement the program in Java.  You could beusing the sample java code provided as a starting point and your first task would be to appropriately comment the code provided.  Once you have finished this task, then you can update the code so that it conforms to your own specifications.

Your code should use appropriate programming standards and should be well documented/commented.  You are permitted to discuss the sample program with your peers in order to understand it. However, you must ensure that you complete this section individually. It is expected that no two students will have the same program. You need to be creative in order to ensure your program is unique.

Part E - Testing

Using the data developed in Part B, test your program to ensure that it works as specified and that there are no logic errors in your code. 

You will need to provide evidence that the testing has been completed - it is suggested that you make use of tables to display the data and testing.

Download:- java programm.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M9742802

Have any Question?


Related Questions in Java

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

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

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

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

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

  • 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