Develop and test a small procedural java program

Assignment Help JAVA Programming
Reference no: EM131317860

Assignment 1

Overview

This is an individual assignment that requires you to design, develop and test a small procedural Java program.

Timelines and Expectations

Learning Outcomes Assessed

The following course learning outcomes are assessed by completing this assessment:
- Identify and use the correct syntax of a common programming language
- Recall and use typical programming constructs to design and implement simple software solutions
- Reproduce and adapt commonly used basic algorithms
- Utilise pseudocode and/or algorithms as a major program design technique
- Write and implement a solution algorithm using basic programming constructs
- Demonstrate debugging and testing skills whilst writing code
- Develop self-reliance and judgement in adapting algorithms to diverse contexts
- Design and write program solutions to identified problems using accepted design constructs

Assessment Details

Your task is to design, develop and test a small application that mimics a fortune teller and tells the user what ‘Federation University' star sign their birth year represents.

Stage 1: Design
This stage requires you to prepare documentation that describes the function of the program and how it is to be tested. There is no coding or code testing involved in this stage. A document template has been provided for your use.

Requirements:
1) Read through Stage 2: Program Development to obtain details of the requirements of this program.
2) Write an algorithm that describes how the program will operate.
a. All program requirements - base, standard and advanced - must be included, even if you do not end up including all these requirements in your program code.
b. The algorithm must be structured logically so that the program would function correctly.
3) Prepare and document test cases that can be used to check that the program works correctly, once it has been coded. You do NOT need to run the test cases in this stage; this will occur in Stage 3: Testing.
a. All program requirements - base, standard and advanced, must be included, even if you do not end up including all these requirements in your program code.
b. Make sure the test cases include checking of data entered by the user to make sure that only valid data is accepted. If the user enters invalid data, the user should be informed of this and given another chance to enter the data. NB: As we have not covered exception handling, you may assume that the user will always enter an integer.
c. Test cases should be documented using a template like the one below. You may include extra information if you wish. At this stage, the Actual Result column will be left blank.

Stage 2: Program Development
Using the Design Documentation to assist you, develop a Java program that mimics a fortune teller and tells the user what ‘Federation University' star sign their birth year represents. These requirements have been broken into three groups:
- Base Functionality includes the minimal level of requirements to achieve the essential components of this assignment. This group of requirements focuses on getting the code to work and on using the programming constructs we cover in class. You can expect to use constants, variables, loops, conditional statements and arithmetic operators for these requirements and you should look for opportunities to use these wherever you can. You will not receive full marks for implementing a requirement, even if it works, if you have not used the appropriate programming construct to do so.
At this level, you can decide if it is easier for you to code everything within a single method, or to modularize it straight away.
- Standard Functionality ensures the code is modularized, and that method calls are used to ensure the program flows correctly. It allows data to pass from one method to another as parameters. It also includes adding an extra menu item that will use three methods of the String class.
- Advanced Functionality provides a challenge task, and is best left until all the other requirements have been addressed. It requires looking at a Java API to find out how to use a class we have not covered in the course, and using this to provide the number of seconds the program has been running for on exit.
All three groups require that you follow coding conventions, such as proper layout of code, using naming conventions and writing meaningful comments throughout your program.

Base Functionality:
1. Display a welcome message when the program starts

- The welcome message should have a row of carets (^) and hashes (#) at the top and the bottom, just long enough to extend over the text. Hint: Use a For loop for this.
- The first line of the message should read "FEDERATION UNIVERSITY AUSTRALIA FORTUNE TELLER" and be approximately centred in the row of carets and hashes by printing white space first. Hint: Can you modify the For loop from the previous step to print the white spaces?
- A second line of the message should be blank.
- The third line should read "Developed by" followed by your name and a comma, then " Student ID ", then your student id, then finally " for ITECH1000 Summer 2016".
- The fourth line should be blank.
- The fifth line should be centered and read "Insight into the unknown".
- The last line should be a repeat of carets (^) and hashes (#)

2. Provide a menu from which the user can select to Consult With A Fortune Teller, get their Federation University Star Sign or Exit. This menu should be repeated each time after the user has chosen and completed an option until the user chooses to Exit. The user selects an option by entering the number next to it. If an invalid number is selected, the user is advised and shown the menu again to make another selection.

3. When the user selects the Consult With A Fortune Teller option, provide another menu from which the user can select "Tell me my lucky number", "Predict the future" or "Return to the Main Menu". The user selects an option by entering the number next to it. If an invalid number is selected, the user is advised and shown the menu again to make another selection. A row of carets (^) and hashes (#) should be at the top
a. Should the user select option 1 they should be shown a random whole number between 1 and 10 (inclusive).

b. Should the user select option 2:
- They are asked to enter their first name, their favourite number between 1 and 10 (inclusive), and whether they like cats (either true or false).

- Once all the data is collected the user should be shown similar output as below
- The first line should read: "After gazing into my magic ball <users name>, I see many things"
-The second line should read: "You entered <favourite number> as your lucky number. Here are <favourite number> stars to wish upon <new line> <a row of asterisks based on the number entered>"
-The third line should read either: "Because you like cats, a friend will ask you only for your time not your money" or "Because you don't like cats, a chance meeting opens new doors to success and friendship"

c. Should the user select option 3 they should be returned to the main menu

4. When the user selects Your Federation University Star Sign they should be prompted to enter the month they were born in. The month should be entered in number format. For example
- Based on the month the user inputs a certain line of text should appear based on the following table

5. When the user selects Exit System, quit the program with a message to the user.

Standard Functionality:

1. Add a new menu item to the first menu called "Analyse my name". When the user selects Analyse my name, a prompt should appear asking for the user's first name, then their surname. The name will then need to be modified (using the conditions below) and displayed back to the user:

a. The first name should be converted so that it is all in lower case
b. The last name should be converted so that it is all in upper case
c. The total length of the full name (first name and surname) should be calculated and returned to the user as the amount of cars they will buy in their life
Hint: Week 7 material will help you or you can look up the String API

2. Modularize the code, correctly using method calls and passing data between methods as parameters.

Advanced Functionality:

3. When the user exits the system add an extra message telling them how long they have been using the program in seconds.
a. Hint: The GregorianCalendar / Calendar class will come in handy.

Stage 3: Testing
Using a copy of the test cases developed in Stage 1: Design, test the program you have developed in
Stage 2: Program Development. Document your results, including both failed and successful tests.
Note: Please do not leave out any failed tests. If your testing highlights that your program has not worked correctly, then the failed tests help to demonstrate that you have been testing your program properly.
To show that you have tested your program, include small (but readable) screen captures in your Actual Results as well as any explanatory comments. Microsoft Windows includes a Snipping Tool that is useful for taking captures of the relevant parts of the screen.
You may test your program in phases if you wish. Stage 2: Program Development provides three separate groups of functionality in the requirements, working from the minimal level of requirements through to more advanced concepts. Each of these groups can be tested individually.

Base Functionality:
This phase requires you to check that the base functions (displaying welcome message when the program starts, showing a menu of options until the user chooses to exit, consulting with a fortune teller, getting a Federation University star sign and exiting the system) have been implemented.

Standard Functionality:
In addition to the Base Functionality, this section includes analysing a name. This new functionality must also be tested.
If you originally wrote and tested the Base Functionality by including all the code in a single method, this phase also requires that you modularize your code, and use method calls and pass data between methods to ensure your program still runs correctly. This means all your code will need to be re- tested to ensure that all the previous functionality still works.

Advanced Functionality:
This phase requires testing the code that calculates how many seconds the program has been running for.

Attachment:- Assignment-Specification.rar

Reference no: EM131317860

Questions Cloud

Design programs that handle events from user-interface : Compare and contrast abstract and concrete data types. Apply the Java concepts of file input / output. Design programs that handle events from user-interface components.
Expected rate of return on the market : Stock A has a beta of 0.4 and investors expect it to return 5%. Stock B has a beta of 1.6 and investors expect it to return 14%. Use the CAPM to find the market risk premium and the expected rate of return on the market.
Expected rate of return on a security : According to the CAPM, would the expected rate of return on a security with a beta less than zero be more or less than the risk-free interest rate? Why would investors be willing to invest in such a security? (Hint: Look back to the auto and gold ..
Prepare an income statement for jackson construction company : Assuming that the company pays income tax a the 40 percent rate, prepare an income statement for Jackson Construction Company.
Develop and test a small procedural java program : ITECH1000 Programming - develop and test a small application that mimics a fortune teller and tells the user what ‘Federation University' star sign their birth year represents and Identify and use the correct syntax of a common programming language
Calculate the ebit : (a) Calculate the EBIT. (b) Calculate the net income. (c) Calculate the OCF. (d) What is the depreciation tax shield?
Calculate the percent earned on operating property : Calculate the Operating ratio, Funded debt to operating property, Percent earned on operating property and Operating revenue to operating property for 2011, 2010, and 2009.
Premium for securities that reduce the systematic : 1. Are portfolio managers willing to pay a premium for securities that reduce the systematic (market) risk of their portfolios? If so, why pay a premium?
Shares of apple stock : The school you would like to attend costs $100,000. To help finance your education, you need to choose whether or not to sell your 1,000 ?shares of Apple stock, 1,000 EE Savings Bonds (with $100 denominations and 4.25% coupon rate) that are five y..

Reviews

len1317860

12/19/2016 3:42:17 AM

i need this work done as per the prescribed norms and specification. So please take care of this as this work is of paramount importance. Thanks Stage 1: Design Documentation Development of an algorithm describing how the program should function • All requirements from the Assessment Details section included 1 • Logical structure 1 Documented test cases to validate program • All requirements from the Assessment Details section included 1 • Data is validated to ensure user entries are appropriate and incorrect user entries are handled smoothly

Write a Review

JAVA Programming Questions & Answers

  Explain the importance of access modifiers

Which access modifier (public, private, protected, default) would you use on a data field in the following cases?

  Write the method in java

2.char mostOftenIn(String s) that for a given string s, returns the character that occurs most often in s.

  Design and develop a console application

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

  How many bits are needed to represent the index size

How many bits are needed to represent the index size - what would be the index size if 8-way set associative cache were used with the same capacity and block size?

  What is localization and why add it to your app

Is Google Cloud Messaging the best approach to use for push notifications? What is localization and why add it to your app?

  Create a java application named distancecalculator

Create a Java application named DistanceCalculator.java to solve the following problem. An application is needed to allow a user to enter two cities and display the distances between them.

  What is the hash function in java

Bob believes that he has come up with a nifty hash function. He assigns a numeric value VChar to each letter in the alphabet equal to the letter's position in the alphabet

  Prepare a mobile android app

The app should target Android and be written in Java, unless you have obtained prior permission from your instructor to target a different platform

  Print the number of lines the number of words

a java program where im supposed to print the number of lines the number of words and the longest line in a text file!

  Design a test program that creates a car object

Also design a test program that creates a Car object, then calls the accelerate method five times, and after each call gets the current speed of the car and displays it. Then it calls the brake method five times, and after each call gets the curre..

  Concept of operator overloading

This lab is to introduce students to the concept of operator overloading as member functions of a class. This will be done in the context of creating a class that will perform four basic mathematical operations on complex numbers

  Write a java program to simulate a die

Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the Math.Random() or the java.util.Random() class to generate the values on the die. The program should prompt the user to enter how ..

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