Identify all of the lines of code within the program

Assignment Help JAVA Programming
Reference no: EM13810402

Assignment 1 - Development of a Simple Menu Driven Program

Part A - Code Comprehension

Your task is to first answer some questions testing your comprehension of the partial solution. Use the sample code provided in StarterCode.java to answer the following questions. Include the answers in your assignment submission.

1. The code provided does not contain any comments.

a. Briefly explain why comments are important in code.

b. Update the code provided to include comments - include a copy of the commented code starter code in your assignment submission.

2. Identify all of the lines of code within the program that are associated with obtaining user input. This can be done by either copying the lines into your answers or highlighting the lines within the code.

3. The variable finished should be used as the condition for the while loop.

a. Briefly explain the purpose of the variable finished.

b. What value will it have when the while loop is initially entered?

4. Run the program. When the menu is presented enter 2 as the selected item.

a. What is the output of the program to the console? Why are all the values 0?

b. Briefly explain how would you should alter the code below so that it displays an appropriate prompt, rather than "Enter Response 1" for each loop:

case 1: System.out.println("Menu selection 1");
for(int i=0;i<surveyResponses.length;i++){
System.out.println("Enter Response 1");

5. Identify the lines that would need to be altered so that the menu is controlled by a do-while loop rather than the while- loop and provide the new lines of code required

6. Currently a switch-statement is used within the program to handle the different menu options. What other program structure could have been used?

7. Run the program.

a. use the following table to test the code provided:

b. Briefly outline the changes would you would need to make to the program so that it handles the menu entries correctly and exits the program when the user enters menu selection 4. Note: You do not need to make the changes in the code for Part A.

8. With the program an array has been used to store the data. Currently the code has two lines declaring the array, one that has been commented out.

a. Briefly explain both of the lines of code used to declare arrays.

b. Briefly explain why the programmer would include the declaration that has been commented out.

Part B - Program Analysis, Implementation and Development

It is suggested that you design, implement and test each of detailed below in order - completing each section completely and correctly before proceeding to the next. For each stage, with the exception of stage 1, you should:

1. design a solution in the form of pseudo-code to carry out the required task - include this pseudo-code as part of your project documentation, clearly indicating which stage it belongs to;

2. perform a desk check of your logic - if you find any problems with your pseudo-code you should redesign and retest;

3. implement the stage - update the code so that it implements the algorithm you have designed - at the end of each stage listed below save a copy of the code that has been developed and name each file appropriately;

4. test the stage - ensure that before moving onto the next stage of development that the program works and that there are no logic or runtime errors

Your code should use appropriate programming standards and 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.

Part C - Testing

You should be testing your program as each stage is completed, and again once the program is complete. You should document the testing data, process and results (e.g. in the form of a table) and include this within your project documentation. Your mark for this section will reflect the thoroughness of your testing and the quality of your documentation.

Attachment:- Assignment.zip

Reference no: EM13810402

Questions Cloud

Dividend growth models to estimate the cost of equity : S. Company has the following capital structure: 45% debt, 15% preferred stock and 40% common stock. Assume the risk-free rate is 8%, the beta stock is 1.3 and the market risk premium (Rm - Rf) is 12%, Determine the weighted average costs of capital (..
Explain how to use the security market line to select stocks : Explain how to use the Security Market Line to select stocks. Explain the significance of the risk-free rate and the market risk premium.
The canterbury tales : The Canterbury Tales
Explain why NPV is preferred over IRR : Explain why NPV is preferred over IRR if there is a conflict between the two methods in the selection of projects
Identify all of the lines of code within the program : Identify all of the lines of code within the program that are associated with obtaining user input. This can be done by either copying the lines into your answers or highlighting the lines within the code.
Replace an existing assembly with a more modern version : The Cement Corp is planning to replace an existing assembly with a more modern version. the old equipment was purchased 5 years ago for $500,000 and depreciated to a zero value over the 5 years. If the cost of capital is 16% and the tax rate is 40%, ..
Complete a roadmap of the current it projects : Using the case provided, build on Part 1 of your IT Strategic Plan. Develop IT strategies to align to the business strategies, complete a roadmap of the current IT projects, propose a new IT project to support the IT strategies, identify risks ass..
Expected rate of return of both stocks using dividend growth : What are the required rates of returns on both stocks using the CAPM model? What are the expected rates of return of both stocks using the dividend growth model. Which stock would you recommend to purchase or sell? Why?
Address the issue of database conversion : In addition, you need to address the issue of database conversion. Once they implement your database, how does your client enter the data they already have?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Balanced and competitive business practices

The United States has several laws that are intended to further fair, balanced, and competitive business practices. Do you think that such laws are effective? If so, why? If not, why not? Be sure to provide evidence to support your position one way o..

  Design and develop a console application

Required to design and develop a console (text-based) application for a small car servicing company -

  Review of classes-objects-arrays and enhance for looping

Write Java code for class Produce that meets the listed requirements

  Construct the student class student.h

Construct the Student Class Student.h and Student.cpp student class should include a Student.h header file for your class definitions and a Student.cpp implementation file comprised of first name, last name, ram id

  Write and run a java program

Write and run a Java program which allows the user to input two doubles and outputs the greater of the two?

  Modify each sorting algorithm

Modify each sorting algorithm so that it keeps track of the number of comparisons it performs and the number of exchanges (swaps) it performs during a single sorting operation. Keep track of these numbers using two long integer counters

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Write a public static method called sumdigits

Write a public static method called sumDigits that will return the sum of the digits within a string.

  Calculate the largest divide by the smallest number

Please also calculate the largest divide by the smallest number provide the quotient and remainder and also put the information as a string on the applet. All the numbers will presented in two decimal places.

  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

  Implement a simple paddle ball game

Implement a simple paddle ball game. Paddle Ball Game Overview The paddle ball game is a simplification of the Pong game. In the Pong game, a ball is moving around the display, bouncing off walls.

  Task 1 create a new project in eclipsecreate a package

task 1 create a new project in eclipse.create a package called lsquopeople within this project. download the start up

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