CSC186 Group Assignment - Printing Service
CSC186 Group Assignment - Printing Service
GROUP ASSIGNMENT
TITLE: PRINTING SERVICE
LECTERUR NAME:
MADAM ZAMLINA BINTI ABDULLAH
1
CSC 186 – PROJECT REPORT EVALUATION RUBRIC
No Assessment Score Weight Total Score Total
Criteria Obtained
1 2 3 4 5 W W x Score
1 Table of Content No page Some page All page NA NA 1 3
numbers numbers are numbers
listed. wrong. being entered
accordingly.
2 Introduction Poor Fair Satisfactory Good Excellent 2 10
description description description descriptiondescription
and no and lack of and a few of and many and many
clear ideas clear ideas. clear ideas. clear ideas.
clear &
at all. creative
ideas.
3 Project Objectives Objectives One/ two Two Two Two 2 10
are not objective(s) objectives objectives objectives
relevant at with no with with good with
all. explanation. satisfactory explanation. excellent and
explanation. concise
explanation.
4 UML diagrams Poor UML Fair UML Satisfactory Good UML Perfect UML 3 15
diagram diagrams with UML diagram diagrams with diagram
with many 7 errors. with 6 errors. at most 5 without any
errors errors. error.
5 Program code The The program The program The program The program 3 15
program is meets only 2 meets only 3 meets all meets all
wrong, requirements. requirements. requirements. requirements
incomplete Include good and optional
and cannot convention requirement
be standard and with
executed. comments. excellent
outcome.
2
6 Sample input and Not At least one Common/sta Good display Provides 2 10
output relevant of input file or ndard display for input and excellent
input and one output for input and output. user
output file. output. interface and
sample. creative
output.
7 References One More than NA NA NA 1 2
reference. one
references.
TOTAL MARKS 65
3
TABLE CONTENT
4
INTRODUCTION
This is a Printing Service Java Program. It consist of 2 attributes which are customer
name and telephone number. This program is to serve printing material according to the
client request. This printing service offer Photostat service and photo album service. Each
service offer different prices depending on size and type the customer choose.
The system can be used by customer and can view the total payment. Next, the employee
can take order and make payment for each customers.
Objectives
To enhance our knowledge in Java coding.
Facilitate customer affairs.
To calculate total price for each categories.
5
CLASS DIAGRAM
Class Printing Service has two private attributes and two classes inherits from it which is
class Photo album and Photostat.
Class photo album has three private attributes which is size, quantity, album.
Class Photostat has two private attributes which is ink type and quantity.
All of this classes has accessor method and printer method.
6
USE CASE DIAGRAM
7
PROGRAM CODE
Class PrintingService
public class PrintingService
{
private String custName;
private String numTel;
//default constructor
public PrintingService()
{
custName = "";
numTel = "";
}
//normal constructor
public PrintingService(String cn, String nt)
{
custName = cn;
numTel = nt;
}
//accessor
public String getCustName()
{
return custName;
}
8
return numTel;
}
//mutator
public void setPrintingService(String cn, String nt)
{
custName = cn;
numTel = nt;
}
//printer
public String toString()
{
return "\n Customer name: " + custName +
"\n Telephone number: " + numTel;
}
}
9
Class PhotoAlbum
public class PhotoAlbum
{
private char size;
private int qty;
private int album;
//default constructor
public PhotoAlbum()
{
size = 0;
qty = 0;
album = 0;
}
//normal constructor
public PhotoAlbum(char s, int q, int a)
{
size = s;
qty = q;
album = a;
}
//accessor
public char getSize()
{
return size;
}
10
public int getQty()
{
return qty;
}
//mutator
public void setPhotoAlbum(char s, int q, int a)
{
size = s;
qty = q;
album = a;
}
//processor
public double calcTotalPrice()
{
double price = 0;
if(size =='A' || size =='a')
{
price = 2.50 * qty;
}
else if(size == 'B' || size =='b')
{
price = 5.00 * qty;
}
11
else if(size == 'C' || size == 'c')
{
price = 7.50 * qty;
}
return price;
}
//printer
public String toString()
{
return
"\n Size of photo album: " + size +
"\n Quantity of photo: " + qty + "pcs" +
"\n Album: " + album;
}
}
12
Class Photostat
public class Photostat
{
private String inkType;
private int quantity;
//default constructor
public Photostat()
{
inkType= "";
quantity = 0;
}
//normal constructor
public Photostat(String it, int qt)
{
inkType = it;
quantity = qt;
}
// acessor
public String getInk()
{
return inkType;
}
13
//mutator
public void setPhotostat(String it, int qt)
{
inkType = it;
quantity = qt;
}
//processor
public double determineInkType()
{
double total =0;
if(inkType.equalsIgnoreCase("BW") || inkType.equalsIgnoreCase("bw"))
{
total = quantity* 0.10;
}
else if(inkType.equalsIgnoreCase("C") || inkType.equalsIgnoreCase("c"))
{
total = quantity * 0.20;
}
return total;
}
//printer
public String toString()
{
return "\n Type of ink: " + inkType +
"\n Quantity: " + quantity ;
}
}
14
Class PrintingApp
import java.util.*;
public class PrintingApp
{
public static void main(String[] args)
{
int service, album;
String name, numTel, inkType;
char size;
15
if(service==1)
{
// Display type of size photo of Photo Album Service
System.out.println("Category: Photo Album Service");
System.out.println("Type of Size Photo:-");
System.out.println("Size A for 10cmx10cm, RM2.50 per photo");
System.out.println("Size B for 12cmx12cm, Rm5.00 per photo");
System.out.println("Size C for 14cmx14cm, RM7.50 per photo");
System.out.println("All the details order for photo album service for today\n");
else if(service == 2)
{
// Display type of ink that use for Photostat Service
System.out.println("Category: Photostat Service");
System.out.println("Type ink used for Photostat: ");
System.out.println("Black & White: 0.10 per paper");
System.out.println("Color: 0.20 per paper");
System.out.println("All the details order for photostat service for today\n");
16
// Ask user to enter ink type and quantity of paper
System.out.println("Please enter type of ink (BW/C): ");
inkType = s.next();
System.out.println("Quantity: ");
int quantity1 = s.nextInt();
p3.setPhotostat(inkType,quantity1);
double total1 = p3.determineInkType();
}
System.out.println("\n*******************************************************************\n");
System.out.println("Customer details:" + p1.toString());
System.out.println(" Category:" + service);
if (service==1)
{
// To calculate total price for Photo Album Service
System.out.println("Details:" + p2.toString());
System.out.println(" Total price: RM " + p2.calcTotalPrice());
}
else if(service==2)
{
// To calculate total price for Photostat Service
System.out.println("Details:" + p3.toString());
System.out.println(" Total price: RM " + p3.determineInkType());
}
17
System.out.println("\nThank you for supporting us! Look forward to serving you
again.");
System.out.println("\n*******************************************************************");
18
OUTPUT
19
20
REFERENCES
https://www.w3schools.com/java/default.asp
PowerPoint Chapter 2 - UML
PowerPoint Chapter 3 - Use Case
21