Solution Code: 1ABCF
This assignment is related to ” Marketing Case Study” and experts at My Assignment Services AU successfully delivered HD quality work within the given deadline.
Case Scenario/ Task
Section 1: Design Documentation
The main menu will be,-
When the user selects option 1, then another sub-menu will display as,-
Step 1: The main() function calls two sub functions like disp_heading() and menu_disp() to implement the modularization feature.
Step 2: In the disp_heading() function, the heading is displayed with for loop ( for * and space) as well as the GregorianCalendar class is used to find the difference between current system date and 1st October,2016. An object is created under GregorianCalendar class and sets the festival (Olympic games) date as 1st October, 2016. Its millisecond is calculated as p.getTime() . The current system date’s time is calculated as millisecond and stored into currentTime. The diff is the difference between current time and p.getTime() in millisecond. Then the millisecond is converted into number of days and stored into res.
Step 3: In the menu_disp() function, using do-while() loop, the menu is implemented as,-
Do
{
Menu 1: Purchase Tickets
Menu 2: View Ticket Sales
Menu 3: Exit System
Enter Menu selection, menusel
Switch (menusel)
{
Case 1: initialize adult_ticket and child_ticket as 0.
Call sub_menu (adult_ticket, child_ ticket);
Case 2: display, Total income from Ticket sales, Adult tickets sold and child tickets sold.
Case 3: Exits from the system.
Default:
}
} while (condition always true);
Step 4: Sub_menu( double adtc, double chtc)
{
Implement Ticket Purchasing Menu’
do
{
Menu 1: Adult Tickets
Menu 2: Child Tickets
Menu 3: Finalize Order
Menu 4: Cancel Order
User input for menu selection, menuSel1
Switch (menusel1)
{
Case 1:
User input for Number of Tickets as x.
If x is negative (<0.0) then re-enters the value of x.
Add x with the value of adtc.(Local variable of adult_ticket that stores added value of adult_ticket’s number in an order.)
Add x with the value of adult_ticket. (Global variable of adult_ticket that stores added value of adult_ticket’s number for all orders.)
Case 2:
User input for Number of Tickets as y.
If y is negative (<0.0) then re-enters the value of y.
Add y with the value of chtc.(Local variable of child_ticket that stores added value of child_ticket’s number in an order.)
Add y with the value of child_ticket. (Global variable of child_ticket that stores added value of child_ticket’s number for all orders.)
Case 3: calculate cost for adult ticket (number*$15.50) and add the cost with global variable, ad_cost. Again, calculate cost for child ticket (number*$5.75) and add the cost with global variable, ch_cost. The total cost is determined locally and updated with global variable, cost.
Display, Adult ticket number and child ticket number with total cost locally.
Return to the Main menu.
Case 4:
As, after choosing option 1 and 2 in the sub-menu the case 4 is executed so, the global variables for adult_ticket and child_ticket is subtracted from local variable, adtc and chtc respectively. If these global variables are negative after subtracting then these should be initialized by 0. Then, return to the main menu.
Default:
}
} while (condition always true);
3.Test Cases
S.No | Test Case | Expected Result | Actual Result | Pass/Fail |
1. | Application displays heading with Advanced functionality. | Application should display headings and show the countdown for days. | Application displays and shows the heading as well as actual countdown for days. | pass |
2. | Applications display a menu | Application should display a menu with options Purchase Tickets, View Ticket Sales and exit from system. | Application displays a menu with options Purchase Tickets, View Ticket Sales and exit from system. | Pass |
3. | If user enters 1, the system should be able to display another menu. | After entering 1, another sub menu with Adult Tickets, Child Tickets, Finalize order and Cancel Order should be displayed. | After entering 1, another sub menu with Adult Tickets, Child Tickets, Finalize order and Cancel Order displays. | Pass |
4. | If user enters 1 and 2 in the sub-menu, the system should accept, Number of Tickets. | If user enters 1 and 2 in the sub-menu, the system should accept, Number of Tickets for Adult and Child respectively. | If user enters 1 and 2 in the sub-menu, the system accepts Number of Tickets for Adult and Child respectively. | Pass |
5. | If user gives the Number of Tickets as negative, the system again accepts for Number of Tickets. | If user gives the Number of Tickets as negative, the system should again accept for Number of Tickets. | If user gives the Number of Tickets as negative, the system again accepts for Number of Tickets by ignoring the negative value. | Pass |
6. | If user enters 3 in the sub-menu, the system calculates cost for adults and child tickets individually as well as total cost. Display appropriate message and returns to the main menu. | If user enters 3 in the sub-menu, the system should calculate cost for adults and child tickets individually as well as total cost and display Adult Ticket number, child ticket number and total cost. Return to the main menu. | If user enters 3 in the sub-menu, the system calculates cost for adults and child tickets individually as well as total cost and display Adult Ticket number, child ticket number and total cost. Return to the main menu. | Pass |
7. | If user enters 4 in the sub-menu, then by re-initializing the variables, appropriate message display and return to the main menu. | If user enters 4 in the sub-menu, then by re-initializing the variables, the system should display, “Order Cancelled” and return to the main menu. | If user enters 4 in the sub-menu, then by re-initializing the variables, the system displays, “Order Cancelled” and return to the main menu. | Pass |
8. | If user enters any number other than 1-4 for choosing option, then the sub-menu re-appears. | If user enters any number other than 1-4 for choosing option, then the sub-menu should re-appear. | If user enters any number other than 1-4 for choosing option, then the sub-menu re-appears. | Pass |
9. | If user enters option 2 in the main menu, then appropriate message displays with total income, Adult ticket numbers and child ticket numbers. | If user enters option 2 in the main menu, then appropriate message should display with total income, Adult ticket numbers and child ticket numbers for all orders. | If user enters option 2 in the main menu, then appropriate message displays with total income, Adult ticket numbers and child ticket numbers for all orders. | Pass |
10. | If user enters option 3 in the main menu, then appropriate message displays and exit from application. | If user enters option 3 in the main menu, then appropriate message should display and exit from application. | If user enters option 3 in the main menu, then appropriate message displays and exit from application. | Pass |
11. | If user enters any number other than 1-3 for choosing option, then the main-menu re-appears. | If user enters any number in the main menu other than 1-3 for choosing option, then the main-menu should re-appears. | If user enters any number in the main menu other than 1-3 for choosing option, then the main-menu re-appears. | Pass |
Section 2: Program Development
The source code for the Application is given below,-
//package include for java input
import java.io.*;
import java.util.Scanner;
//package include for date calculation
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class OlympicGames{
//global variables
static double ad_tckt=0.0;
static double ch_tckt=0.0;
static double x;
static double y;
static double ad_cost=0.0;
static double ch_cost=0.0;
static double cost=0.0;
static boolean flag=false; static int menuSel,menuSel1; static boolean f=false;
static Scanner ip=new Scanner(System.in);
public static void main(String[] args)
{
disp_heading(); //modularized code
menu_disp();
}
public static void disp_heading() //Base Functionality
{
//displaying heading
for(int i=0;i<70;i++)
System.out.print("*");
for(int j=0;j<20;j++)
System.out.print(" ");
System.out.println("FEDERATION UNIVERSITY AUSTRALIA OLYMPICS");
System.out.println();
System.out.println("Developed by , student ID , for ITECH1000 Sem 2 2016");
System.out.println();
//Advanced Functionality
GregorianCalendar d = new GregorianCalendar();
d.set(2016, Calendar.OCTOBER,1);
Date p=d.getTime();
/** Today's date */
Date today = new Date();
long currentTime = today.getTime();
// Get msec from each, and subtract.
long diff = p.getTime()-currentTime;
long res=diff / (1000 * 60 * 60 * 24);
for(int j=0;j<15;j++)
System.out.print(" ");
System.out.println("Let the games begin ! "+ res +" days to go !");
System.out.println();
for(int i=0;i<70;i++)
System.out.print("*");
}
public static void menu_disp() //Base Functionality
{
do {
System.out.println("\n\nPlease select an option from the Menu:"); //Displays the menu
System.out.println("1. Purchase Tickets");
System.out.println("2. View Ticket Sales");
System.out.println("3. Exit System ");
System.out.println("Enter menu select:");
menuSel=ip.nextInt();
//Enters value for menu selection
switch(menuSel){
case 1:
double ad_tkt=0.0;
double ch_tkt=0.0;
sub_menu(ad_tkt,ch_tkt); // function call with parameters and modularization
break;
case 2: for(int i=0;i<50;i++)
System.out.print("*");
System.out.println();
System.out.println("Total Income from Ticket Sales: $" + cost);
System.out.println();
System.out.println("Adult tickets sold:" +ad_tckt);
System.out.println("Child tickets sold:" +ch_tckt);
for(int i=0;i<50;i++)
System.out.print("*");
break;
case 3: System.out.println("The Federation University Australia olympics Ticketing system is now exiting....");
//Base Functionality,if user choices 3, exits from system
System.exit(0);
default:
break; // If user choices any number other than 1 to 3
}
}while(!flag); //condition always true, as flag !=TRUE
}
public static void sub_menu(double adtc, double chtc) //Standard Functionality
{
System.out.println("TICKET PURCHASING MENU ");
do
{
System.out.println("Your order currently contains"+adtc +" Adult ticket(s) and "+ chtc +" Child ticket(s)"); //Standard Functionality
f=false;
System.out.println("Please select an option from the list:");
//Displays the sub-menu
System.out.println("1. Adult Tickets");
System.out.println("2. Child Tickets");
System.out.println("3. Finalize Order ");
System.out.println("4. Cancel Order ");
System.out.println("Enter menu select:");
menuSel1=ip.nextInt();
//Enters value for menu selection
switch(menuSel1){
case 1:
do
{
System.out.println("Number of Tickets:");
x=ip.nextDouble();
}while(x<0.0);
adtc+=x;
ad_tckt+=x;
break;
case 2:
do
{
System.out.println("Number of Tickets:");
y=ip.nextDouble();
}while(y<0.0);
chtc+=y;
ch_tckt+=y;
break;
case 3:
double adcst=adtc*15.50;
ad_cost+=adcst;
double chcst=chtc*5.75;
ch_cost+=chcst;
double total=adcst+chcst;
cost+=total;
System.out.println("Your Order of "+ adtc +" adult ticket(s) and " + chtc +" child ticket(s) amounts to $"+ total); //Base Functionality
f=true;
break;
case 4:
ad_tckt-=adtc; ch_tckt-=chtc;
if (ad_tckt<0.0 || ch_tckt<0.0)
ad_tckt=ch_tckt=0.0;
System.out.println("Order Cancelled.");
adtc=0.0; chtc=0.0;
f=true;
break;
default:
break;
}
}while(!f);
} // end of function
}// end of class
Section 3: Testing
The Test Cases are:
S.No | Test Case | Expected Result | Actual Result | Pass/Fail |
1. | Application displays heading with Advanced functionality. | Application should display headings and show the countdown for days. | Application displays and shows the heading as well as actual countdown for days. | pass |
2. | Applications display a menu | Application should display a menu with options Purchase Tickets, View Ticket Sales and exit from system. | Application displays a menu with options Purchase Tickets, View Ticket Sales and exit from system. | Pass |
3. | If user enters 1, the system should be able to display another menu. | After entering 1, another sub menu with Adult Tickets, Child Tickets, Finalize order and Cancel Order should be displayed. | After entering 1, another sub menu with Adult Tickets, Child Tickets, Finalize order and Cancel Order displays. | Pass |
4. | If user enters 1 and 2 in the sub-menu, the system should accept, Number of Tickets. | If user enters 1 and 2 in the sub-menu, the system should accept, Number of Tickets for Adult and Child respectively. | If user enters 1 and 2 in the sub-menu, the system accepts Number of Tickets for Adult and Child respectively. | Pass |
5. | If user gives the Number of Tickets as negative, the system again accepts for Number of Tickets. | If user gives the Number of Tickets as negative, the system should again accept for Number of Tickets. | If user gives the Number of Tickets as negative, the system takes the negative value and calculates on it. | Fail |
6. | If user enters 3 in the sub-menu, the system calculates cost for adults and child tickets individually as well as total cost. Display appropriate message and returns to the main menu. | If user enters 3 in the sub-menu, the system should calculate cost for adults and child tickets individually as well as total cost and display Adult Ticket number, child ticket number and total cost. Return to the main menu. | If user enters 3 in the sub-menu, the system calculates cost for adults and child tickets individually as well as total cost and display Adult Ticket number, child ticket number and total cost. Return to the main menu. | Pass |
7. | If user enters 4 in the sub-menu, then by re-initializing the variables, appropriate message display and return to the main menu. | If user enters 4 in the sub-menu, then by re-initializing the variables, the system should display, “Order Cancelled” and return to the main menu. | If user enters 4 in the sub-menu, then by re-initializing the variables, the system displays, “Order Cancelled” and return to the main menu. | Pass |
8. | If user enters any number other than 1-4 for choosing option, then the sub-menu re-appears. | If user enters any number other than 1-4 for choosing option, then the sub-menu should re-appear. | If user enters any number other than 1-4 for choosing option, then the sub-menu re-appears. | Pass |
9. | If user enters option 2 in the main menu, then appropriate message displays with total income, Adult ticket numbers and child ticket numbers. | If user enters option 2 in the main menu, then appropriate message should display with total income, Adult ticket numbers and child ticket numbers for all orders. | If user enters option 2 in the main menu, then appropriate message displays with total income, but Adult ticket numbers and child ticket numbers for all orders are not displayed properly. | Fail |
10. | If user enters option 3 in the main menu, then appropriate message displays and exit from application. | If user enters option 3 in the main menu, then appropriate message should display and exit from application. | If user enters option 3 in the main menu, then appropriate message displays and exit from application. | Pass |
11. | If user enters any number other than 1-3 for choosing option, then the main-menu re-appears. | If user enters any number in the main menu other than 1-3 for choosing option, then the main-menu should re-appears. | If user enters any number in the main menu other than 1-3 for choosing option, then the main-menu re-appears. | Pass |
These assignments are solved by our professional Programming Assignment help expertsat My Assignment Services AU and the solution are high quality of work as well as 100% plagiarism free. The assignment solution was delivered within 2-3 Days.
Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Overview
This is an individual assignment that requires you to design, develop and test a small procedural Java program.
Timelines and Expectations
Percentage Value of Task: 20%
Due: 16:00 Friday the 2nd of September (week 7)
Minimum time expectation: 10 hours
Learning Outcomes Assessed
The following course learning outcomes are assessed by completing this assessment:
CRICOS Provider No. 00103D 1617 Assignment 1 specification.docx Page 1 of 9
ITECH1000 / ITECH5000 Programming 1 1617
Assessment Details
The Federation University Australia Olympic Games are about to commence! The games have been scheduled to begin on Saturday 1st October 2016, competitors are busy training and now it’s time to prepare to sell spectator tickets.
Your task is to design, develop and test a small application for recording ticket sales to this event.
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.
do not end up including all these requirements in your program code.
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 actually run the test cases in this stage; this will occur in Stage 3: Testing.
do not end up including all these requirements in your program code.
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.
extra information if you wish. At this stage, the Actual Result column will be left blank.
Test Case Expected Result Actual Result
The user selects to purchase adult tickets.
The user is prompted to enter the number of tickets to purchase.
CRICOS Provider No. 00103D 1617 Assignment 1 specification.docx Page 2 of 9
Stage 2: Program Development
Using the Design Documentation to assist you, develop a Java program that records spectator ticket sales at the gate for the Federation University Australia Olympic Games, implementing the requirements outlined in this section. These requirements have been broken into three groups:
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.
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:
CRICOS Provider No. 00103D 1617 Assignment 1 specification.docx Page 3 of 9
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.
can select Adult Tickets, Child Tickets, Finalise Order or Cancel Order. 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.
Number of Tickets required. After entering the number of tickets required, they are returned to the Ticket Purchasing Menu so that they may choose to purchase additional tickets. The user may not choose to purchase a negative number of tickets, but a purchase of 0 tickets is permitted.
CRICOS Provider No. 00103D 1617 Assignment 1 specification.docx Page 4 of 9
iii. The user is returned to the menu from Step 2.
the total number of adult tickets and the total number of child tickets sold across ALL orders. Highlight this message display with a row of 50 asterisks before and after the message. After the final row of asterisks, redisplay the menu from Step 2.
CRICOS Provider No. 00103D 1617 Assignment 1 specification.docx Page 5 of 9
Standard Functionality:
displayed until the order is finalized
parameters.
Advanced Functionality:
games begin.
java.util.GregorianCalendar to use this library.
program runs, and Saturday 1st October 2016.
CRICOS Provider No. 00103D 1617 Assignment 1 specification.docx Page 6 of 9
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, purchasing tickets, viewing ticket sales and exiting the system) have been implemented.
Standard Functionality:
In addition to the Base Functionality, this section includes displaying a running total of tickets that have been added to an order until such time as the order has been finalized. 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 and displays the number of days until the games comments in the welcoming message shown when the program starts.
Find Solution forProgramming Assignmentby dropping us a mail at help@myassignmentservices.com.au along with the question’s URL. Get in Contact with our experts at My Assignment Services AU and get the solution as per your specification & University requirement.
Trending now
The Student Corner
Subscribe to get updates, offers and assignment tips right in your inbox.
Popular Solutions
Popular Solutions
Request Callback
Doing your Assignment with our resources is simple, take Expert assistance to ensure HD Grades. Here you Go....