Programming Concepts. Andora Video is a small shop selling videos. The owner, Raul, wishes to develop a sales transaction processing system. The main objective of this system should be to display the total price of the sale after discounts, tax e.t.c.

Authors Avatar

Unit 3 – Programming Concepts                 

Table of Contents

INTRODUCTION        

SCENARIO        

USER REQUIREMENTS        

INFORMATION        

GUI (GRAPHIC USER INTERFACE)        

VERSION 1        

REQUIREMENTS        

DATA TABLE        

DESIGN PSEUDOCODE        

IMPLEMENTATION (v. 1)        

TESTING        

Syntax Errors        

Logical Errors        

VERSION 2        

REQUIREMENTS        

DATA TABLE        

DESIGN PSEUDOCODE        

IMPLEMENTATION (v. 2)        

TESTING        

Syntax Errors        

Logical Errors – Order 1        

Logical Errors – Order 2 (first attempt)        

Logical Errors – Order 2 (second attempt)        

VERSION 3        

REQUIREMENTS        

DATA TABLE        

DESIGN PSEUDOCODE        

FINAL IMPLEMENTATION (v. 3)        

TESTING        

Database connectivity        

EVALUATION        

CONCLUSION        

BIBLIOGRAPHY        

BOOKS        

WEBSITES        

SOFTWARE        

  1. INTRODUCTION

  1. SCENARIO

Andora Video is a small shop selling videos. The owner, Raul, wishes to develop a sales transaction processing system. The main objective of this system should be to display the total price of the sale after discounts, tax e.t.c.  This should occur as a result of the input of data surrounding the video and its purchase.

  1. USER REQUIREMENTS

  • An application that is able to process multiple video titles
  • Calculates discounts, VAT and totals
  • Determine different discounts based upon the quantity
  • Display calculations in relevant format
  • Store inputted and calculated data into a electronic record
  • Capable of supporting further development

Although Raul needs the application to process multiple video titles in one transaction, I shall however start off with designing a simple program to process just one title at a time. After that, I intend expanding from this stage, adding more functionality as time goes on with each version.

  1. INFORMATION

Some of the work was carried out directly from the command prompt in Windows. However, at other times an integrated development environment (IDE) was used so one may see a difference in the error message output. The IDE used was the Open Source NetBeans software version 6.1 for Windows Vista.

Testing is carried out on all versions and any errors corrected and explained. Evaluation is carried out at the very end of this document, and suggestions are made on possible improvements that can be made to the program.

  1. A user guide in the format of a PowerPoint is provided separately for the final version of this project.

  1. GUI (GRAPHIC USER INTERFACE)

  2. If there is sufficient time, I aim to put the following GUI interface design into my program in order to input the data.

If I do run out of time, then I shall implement single input dialog boxes in my program (see designs below).

In the final version I intend on concluding the program with a output message box (see design below).

  1. VERSION 1

  2. The first version shall not have a Graphic User Interface (GUI) as this will enable us to better understand the logic needed behind such a project.
  1. REQUIREMENTS

Input:                 String vdID, vdTitle,

int vdQty,

double vdPrice,

final double         vatRate = .175, disFor15Plus = 0.25,

                disFor10To14 = 0.17, disFor5To9 = 0.12

Output:         String vdID, vdTitle,

int vdQty,

double vdPrice, vdSubtotal,  dSubtotal, vdTotal, discount, VAT

Process:        vdSubtotal = vdQty*vdPrice

discount=vdsubtotal*disFor…

                dSubtotal=vdSubtotal-discount

VAT=dSubtotal*vatRate                

Total=dSubtotal+VAT

  1. DATA TABLE

  1. DESIGN PSEUDOCODE

Declare vat and discount rates constants

Prompt for video ID, Title, Price and Quantity

Read inputted values

vdSubtotal = vdPrice*vdQty

if vdQtyAll >= 15

discount = disFor15Plus * vdSubtotalAll

if vdQtyAll >= 10

discount = disFor10To14 * vdSubtotalAll

if vdQtyAll >= 5

discount = disFor5To9 * vdSubtotalAll

else

discount = 0

display dSubtotal

display total

  1. IMPLEMENTATION (v. 1)

import java.util.Scanner;

public class VideoSales1

{

public static void main (String[] args)

         

{

//Declaring Variables needed in the program and added values to the constants

String vdID, vdTitle;

int vdQty;

double vdPrice, discount;

final double vatRate = 0.175;

final double disFor15Plus = 0.25;

final double disFor10To14 = 0.17;

final double disFor5To9 = 0.12;

        

        // Asking for input from the user regarding the video ID, Title, Quantity, Price

System.out.println("Video ID?");

Scanner sc1 = new Scanner(System.in);

vdID = sc1.next();

Join now!

        

System.out.println("Video Title?");

Scanner sc2 = new Scanner(System.in);

vdTitle = sc2.next();

        

System.out.println("Quantity?");

Scanner sc3 = new Scanner(System.in);

vdQty = sc3.nextInt();

        

System.out.println("vdPrice?");

Scanner sc4 = new Scanner(System.in);

vdPrice = sc4.nextDouble();

        

// Displaying the previously entered information

System.out.println("\n" +"Your Order details below...");

System.out.println("Video ID: "+ vdID);

System.out.println("Video Title: "+ vdTitle);

System.out.println("Video Price: "+ vdPrice);

System.out.println("Quantity: "+ vdQty);

                        

//Subtotal is calculated and displayed

double vdSubtotal = vdPrice * vdQty;

System.out.println("Subtotal: " + vdSubtotal);

                

        // Discount is calculated depending on the quantity

        if (vdQty >= 15)

        discount = disFor15Plus * vdSubtotal;

        else

        if (vdQty >= 10)

        discount = ...

This is a preview of the whole essay