Design constraintsyour program should confirm to the

Assignment Help JAVA Programming
Reference no: EM13373186

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

Reference no: EM13373186

Questions Cloud

Case study - technology and economic change getting the : case study - technology and economic change getting the benefits fromtasks to be undertakenbull read chapter 13 in
Case studypart 1axolotl corporation a small company from : case studypart 1axolotl corporation a small company from eastern washington is currently producing avionic parts and
Need help figuring out the proper steps on how to solvewhat : need help figuring out the proper steps on how to solvewhat volume of 1.25m hcl in liters is needed to react completely
Create an application for an animal-fur trimming service : create an application for an animal-fur trimming service. the business is open 15 weeks of the year from april through
Design constraintsyour program should confirm to the : design constraintsyour program should confirm to the following constraints.nbsp it shouldinclude at least one example
Questions1 write a programme that computes the rental : questions1. write a programme that computes the rental charge given the type of moped when it is rented weekday or
Question 1 the text file xydata5 contains the variables x1 : question 1. the text file xydata5 contains the variables x1 y1 x2 and y2. for this question hand in your r commands
One of the most important skills to learn in managerial : one of the most important skills to learn in managerial economics is the ability to identify a good business.1- discuss
Advanced management accountingplease include thorough : advanced management accountingplease include thorough explanation and thorough calculations for each answer

Reviews

Write a Review

JAVA Programming Questions & Answers

  Consumer and business product and discuss

Name a product that could be described as both a consumer and business product and discuss why. Describe its attributes, uses and product perceptions of the customers in both markets.

  Using a linked implementation of graph write a method

Write a method that takes two nodes as input and returns true if joining an edge between these two nodes, forms a duplicate path to one of the input nodes within the graph.

  Modify the book class to accommodate multiple authors

modify the Book class to accommodate multiple authors using one of the components from the Java Collection Framework.

  Design and implement a small and simple email server

Design and implement a small and simple email server

  Java write a program that creates a 4 x 6 two-dimensional

Using Java write a program that creates a 4 x 6 two-dimensional array. The program should use loops to populate the array with random numbers between 1 and 100. After the values have populated the array, output the values of the array to the screen i..

  Explain the inventory program to include an add button

Modify the Inventory Program to include an add button, a delete button, and a modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock

  Write a functions that takes an array of doubles

1. Write a function that is passed a single integer and then calculates the factorial of that number. A factorial is the product of the integer times all of the integers below it stopping at 1. So n!= n*(n-1)*(n-2).......3.2.1

  1 ra row your boatprepare a world with a boat a person

1. ra row your boatprepare a world with a boat a person sitting in the boat an island and a pier located 25 meters from

  A java program that reads the records

A java program that reads the records from the golf.dat file and displays them. It also displays the name of the player with the best (lowest) golf score.

  Die class that can hold an integer

Design a die class that can hold an integer from 1 to 6. use the dice class to create a dice game. in this game, the user chooses a number between 2 and 12 inclusive

  Implement a class quiz

Implement a class Quiz that implements the Measurable interface.

  Design java program to enter name in input dialog box

Design the program called MailingLabel.java Program must ask user to enter name and address in input dialog box with each component of address seperated by comma.

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