COM5003 Programming Portfolio: Java, OOP Concepts, and SIMS Project
VerifiedAdded on 2020/06/06
|12
|2732
|107
Homework Assignment
AI Summary
This programming portfolio showcases a student's understanding of object-oriented programming (OOP) and its practical applications. The assignment includes Java code for calculating the average of five numbers and counting words in a string. It then delves into a critical evaluation of OOP principles, discussing objects, classes, and methods. Furthermore, the portfolio presents a design for an Online Sales and Inventory Management System (SIMS), outlining its modules, software and hardware requirements, and use case diagrams. The student also provides a class diagram illustrating the relationships between the employee, department, and company tables, as well as the project table. The assignment also provides an abstract of the SIMS system and explores the existing and proposed systems with all the modules. The portfolio effectively demonstrates the student's ability to apply OOP concepts and design practical software solutions.

Programming
Task 1
a) Write a Java method to compute the average of five numbers
import java.util.Scanner;
public class Avg5 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Input first number: ");
int num1 = in.nextInt();
System.out.print("Input second number: ");
int num2 = in.nextInt();
System.out.print("Input third number: ");
int num3 = in.nextInt();
System.out.print("Input fourth number: ");
int num4 = in.nextInt();
System.out.print("Enter fifth number: ");
int num5 = in.nextInt();
System.out.println("Average of five numbers is: " +
(num1 + num2 + num3 + num4 + num5) / 5);
}
}
Task 1
a) Write a Java method to compute the average of five numbers
import java.util.Scanner;
public class Avg5 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Input first number: ");
int num1 = in.nextInt();
System.out.print("Input second number: ");
int num2 = in.nextInt();
System.out.print("Input third number: ");
int num3 = in.nextInt();
System.out.print("Input fourth number: ");
int num4 = in.nextInt();
System.out.print("Enter fifth number: ");
int num5 = in.nextInt();
System.out.println("Average of five numbers is: " +
(num1 + num2 + num3 + num4 + num5) / 5);
}
}
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

b) Write a Java method to count all words in a string.
import java.util.Scanner;
public class wordcount {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Input the string: ");
String str = in.nextLine();
System.out.print("Number of words in the string: " + count_Words(str)+"\n");
}
public static int count_Words(String str)
{
int count = 0;
if (!(" ".equals(str.substring(0, 1))) || !(" ".equals(str.substring(str.length() - 1))))
{
for (int i = 0; i < str.length(); i++)
{
if (str.charAt(i) == ' ')
{
count++;
}
}
count = count + 1;
}
return count; // returns 0 if string starts or ends with space " ".
}
}
import java.util.Scanner;
public class wordcount {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Input the string: ");
String str = in.nextLine();
System.out.print("Number of words in the string: " + count_Words(str)+"\n");
}
public static int count_Words(String str)
{
int count = 0;
if (!(" ".equals(str.substring(0, 1))) || !(" ".equals(str.substring(str.length() - 1))))
{
for (int i = 0; i < str.length(); i++)
{
if (str.charAt(i) == ' ')
{
count++;
}
}
count = count + 1;
}
return count; // returns 0 if string starts or ends with space " ".
}
}

Task 2
Class Diagram
Employee Table related to depart table.
Department table related to Company table.
Project table is related to company tables.
Task 3
Class Diagram
Employee Table related to depart table.
Department table related to Company table.
Project table is related to company tables.
Task 3
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

a) In a maximum of 500 words, critically evaluate the principles of object oriented programming.
Today, object oriented programming will be the predominant programming paradigm as well as Java is
completely object targeted. In addition , Java is probably the many used language among THAT service
providers. Therefore , students often learn Java and subject oriented programming (OOP) actually in
introductory courses. This allows a perfect basis for a “later introduction to other paradigms including
logical or functional encoding (Bailie, Blank, Murray and Rajaravivarma, 2003). Moreover, OOP also helps
launching students to concepts similar to specification, construction and resistant.
These approaches start by showing objects, interfaces, classes and also functions from the beginning, e. h.
the Outside-In teaching way of OOP based on the programming vocabulary Eiffel. Problem Statement:
Regardless of several lecturers having at present used the Outside-In teaching approach in their courses,
little research evidence on its outcomes exists. Some authors looked at the program compilation behavior
connected with involved students, but its influence on learning outcomes as well as enthusiasm and
interest has not been researched so far. Research Objective: Educating OO concepts to apprentices is an
important task of program engineering education (Bailie, Courtney and Tuohy, 2003). Therefore , with this
paper the feasibility as well as effects of using Outside-In educating for teaching OOP within university-
level introductory courses making use of Java are empirically looked at. In particular, the objective was to
realize its impact on learning positive aspects as well as on interest and ideas of the participants. Context:
We all evaluated Outside-In teaching in parallel in two opening courses for computer scientific research
and OOP (Bachelor stage, 1st year) at a pair of German universities in the winter period 2012/13. The
courses have been Programming and Software Growth (PSD) at the University regarding Stuttgart
(Stuttgart) and Encoding Technique from the study course “Information Management Automotive”
(IMA) at the University of Modern advances Neu-Ulm (Ulm).
The major obstacle was the replacement of Eiffel simply by Java. Eiffel is more puristic in its object-
oriented constructs as compared to Java. For example , for Coffee an early introduction of permanent
methods is necessary because the technique is executed with the everlasting main method. The concept of
carrying out a program in Eiffel will be considerably easier. Compared to Eiffel, Java lacks a local
support for contracts, thus additional tools have to be applied. Regarding the scope, the two classes at
Ulm and Stuttgart distinctly differ (Janke, Brune and Wagner, 2015). Programming together with Software
Development (PSD) with Stuttgart consists of four hrs lecture and two days tutorials with teaching
colleagues per week. Programming Technique inside Ulm consists of two many hours lecture and two
period lecturer-guided tutorials. Furthermore, only two additional hours of recommended tutorial per
week are offered. Several topics like the setup as well as the functional principle of a personal computer
or data structures are generally units of separate address courses at Ulm. That is why, these units are not
included here. Thus, compared to Ulm, at Stuttgart much more issues are discussed during a session. PSD
at Stuttgart resembles an introduction to computer engineering. The aim of the course can be a broad
introduction to the field about computer science and at the very least to strike all simple topics. Hence,
topics just like the principles of computer hardware or maybe the complexity of algorithms may also be
briefly discussed.
b) In clear terms, explain your understanding of each of the following object-orientated programming
concepts:
Today, object oriented programming will be the predominant programming paradigm as well as Java is
completely object targeted. In addition , Java is probably the many used language among THAT service
providers. Therefore , students often learn Java and subject oriented programming (OOP) actually in
introductory courses. This allows a perfect basis for a “later introduction to other paradigms including
logical or functional encoding (Bailie, Blank, Murray and Rajaravivarma, 2003). Moreover, OOP also helps
launching students to concepts similar to specification, construction and resistant.
These approaches start by showing objects, interfaces, classes and also functions from the beginning, e. h.
the Outside-In teaching way of OOP based on the programming vocabulary Eiffel. Problem Statement:
Regardless of several lecturers having at present used the Outside-In teaching approach in their courses,
little research evidence on its outcomes exists. Some authors looked at the program compilation behavior
connected with involved students, but its influence on learning outcomes as well as enthusiasm and
interest has not been researched so far. Research Objective: Educating OO concepts to apprentices is an
important task of program engineering education (Bailie, Courtney and Tuohy, 2003). Therefore , with this
paper the feasibility as well as effects of using Outside-In educating for teaching OOP within university-
level introductory courses making use of Java are empirically looked at. In particular, the objective was to
realize its impact on learning positive aspects as well as on interest and ideas of the participants. Context:
We all evaluated Outside-In teaching in parallel in two opening courses for computer scientific research
and OOP (Bachelor stage, 1st year) at a pair of German universities in the winter period 2012/13. The
courses have been Programming and Software Growth (PSD) at the University regarding Stuttgart
(Stuttgart) and Encoding Technique from the study course “Information Management Automotive”
(IMA) at the University of Modern advances Neu-Ulm (Ulm).
The major obstacle was the replacement of Eiffel simply by Java. Eiffel is more puristic in its object-
oriented constructs as compared to Java. For example , for Coffee an early introduction of permanent
methods is necessary because the technique is executed with the everlasting main method. The concept of
carrying out a program in Eiffel will be considerably easier. Compared to Eiffel, Java lacks a local
support for contracts, thus additional tools have to be applied. Regarding the scope, the two classes at
Ulm and Stuttgart distinctly differ (Janke, Brune and Wagner, 2015). Programming together with Software
Development (PSD) with Stuttgart consists of four hrs lecture and two days tutorials with teaching
colleagues per week. Programming Technique inside Ulm consists of two many hours lecture and two
period lecturer-guided tutorials. Furthermore, only two additional hours of recommended tutorial per
week are offered. Several topics like the setup as well as the functional principle of a personal computer
or data structures are generally units of separate address courses at Ulm. That is why, these units are not
included here. Thus, compared to Ulm, at Stuttgart much more issues are discussed during a session. PSD
at Stuttgart resembles an introduction to computer engineering. The aim of the course can be a broad
introduction to the field about computer science and at the very least to strike all simple topics. Hence,
topics just like the principles of computer hardware or maybe the complexity of algorithms may also be
briefly discussed.
b) In clear terms, explain your understanding of each of the following object-orientated programming
concepts:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

i) Objects
An object is a component of a program that knows how to perform certain actions and how to
interact with other elements of the program. Objects are the basic units of object-oriented
programming. A simple example of an object would be a person. Logically, you would expect a
person to have a name (Bruegge, B, 1992). This would be considered a property of the person. You
could also expect a person to be able to do something, such as walking or driving. This would be
considered a method of the person.
ii) Classes
A class is a blueprint of an object. You can think of a class as a concept, and the object is the
embodiment of that concept. You need to have a class before you can create an object. So, let's
say you want to use a person in your program (Jadud, 2005). You want to be able to describe the
person and have the person do something. A class called 'person' would provide a blueprint for
what a person looks like and what a person can do. To actually use a person in your program, you
need to create an object. You use the person class to create an object of the type 'person.' Now
you can describe this person and have it do something.
iii) Methods
A method in object-oriented programming is a procedure associated with a class. A method defines
the behavior of the objects that are created from the class. Another way to say this is that a method is
an action that an object is able to perform (Cohen, 1987). The association between method and class is
called binding. Consider the example of an object of the type 'person,' created using the person class.
Methods associated with this class could consist of things like walking and driving. Methods are
sometimes confused with functions, but they are distinct.
Task 4
Online Sales and Inventory Management System (SIMS)
An object is a component of a program that knows how to perform certain actions and how to
interact with other elements of the program. Objects are the basic units of object-oriented
programming. A simple example of an object would be a person. Logically, you would expect a
person to have a name (Bruegge, B, 1992). This would be considered a property of the person. You
could also expect a person to be able to do something, such as walking or driving. This would be
considered a method of the person.
ii) Classes
A class is a blueprint of an object. You can think of a class as a concept, and the object is the
embodiment of that concept. You need to have a class before you can create an object. So, let's
say you want to use a person in your program (Jadud, 2005). You want to be able to describe the
person and have the person do something. A class called 'person' would provide a blueprint for
what a person looks like and what a person can do. To actually use a person in your program, you
need to create an object. You use the person class to create an object of the type 'person.' Now
you can describe this person and have it do something.
iii) Methods
A method in object-oriented programming is a procedure associated with a class. A method defines
the behavior of the objects that are created from the class. Another way to say this is that a method is
an action that an object is able to perform (Cohen, 1987). The association between method and class is
called binding. Consider the example of an object of the type 'person,' created using the person class.
Methods associated with this class could consist of things like walking and driving. Methods are
sometimes confused with functions, but they are distinct.
Task 4
Online Sales and Inventory Management System (SIMS)

ABSTRACT
An internet Sales and Inventory Management (SIMS) for a departmental store. This method can be used
to store the details from the inventory, update the stock based on the sale details, generate receipts for
sales, produce sales and inventory reviews periodically etc . This is 1 integrated system that contains both
user component (used through salespersons, sales managers, supply managers etc) and the administrative
component (used by the managers for performing admin degree functions such as adding brand new items
to the inventory, altering the price of an item etc).
This technique runs on multiple definitive, offers a GUI interface in order to its users and connects to
some common database(s).
Existing System:-
From the existing system the income can purchase the products only guide book nothing but he went to
typically the supermarket buying the goods with this no reliability after purchasing the products some
time returns is simply not allowed or if let every we need go to retailers return to the goods it is time
taking in process. In farmer nights online shopping sites not maintain the almost all much products
(Cooper, Dann and Pausch, 2003). When we desire to purchase the products redirect straight into different
sites and buying in the event that the user need to maintain just about all sites transaction. It is not easy to
manage.
Proposed System:-
This particular project is to developed to have an online Sales and Stock Management System
(SIMS) for a chain store. This system can be used to store the facts of the inventory, update the actual
inventory based on the sale information, produce receipts for product sales, generate sales and stock
reports periodically etc (Corbin and Strauss, 2008). This really is one integrated system which has both the
user component (used by salespersons, sales administrators, inventory managers etc.) and also the admin
component (used through the administrators for performing administrative level functions such as
including new items to the supply, changing the price of an item etc.).
This system runs on several terminals, offers a GUI user interface to its users and links to a
common database(s).
MODULES:-
An internet Sales and Inventory Management (SIMS) for a departmental store. This method can be used
to store the details from the inventory, update the stock based on the sale details, generate receipts for
sales, produce sales and inventory reviews periodically etc . This is 1 integrated system that contains both
user component (used through salespersons, sales managers, supply managers etc) and the administrative
component (used by the managers for performing admin degree functions such as adding brand new items
to the inventory, altering the price of an item etc).
This technique runs on multiple definitive, offers a GUI interface in order to its users and connects to
some common database(s).
Existing System:-
From the existing system the income can purchase the products only guide book nothing but he went to
typically the supermarket buying the goods with this no reliability after purchasing the products some
time returns is simply not allowed or if let every we need go to retailers return to the goods it is time
taking in process. In farmer nights online shopping sites not maintain the almost all much products
(Cooper, Dann and Pausch, 2003). When we desire to purchase the products redirect straight into different
sites and buying in the event that the user need to maintain just about all sites transaction. It is not easy to
manage.
Proposed System:-
This particular project is to developed to have an online Sales and Stock Management System
(SIMS) for a chain store. This system can be used to store the facts of the inventory, update the actual
inventory based on the sale information, produce receipts for product sales, generate sales and stock
reports periodically etc (Corbin and Strauss, 2008). This really is one integrated system which has both the
user component (used by salespersons, sales administrators, inventory managers etc.) and also the admin
component (used through the administrators for performing administrative level functions such as
including new items to the supply, changing the price of an item etc.).
This system runs on several terminals, offers a GUI user interface to its users and links to a
common database(s).
MODULES:-
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

This project is aimed at developing an online Sales and Inventory Management System (SIMS)
for a departmental store.
The Project has the following modules
o Sales Manager
o Sales Person
o Inventory Manager
o Admin
1. A sales person should be able to
o login to the system through the preliminary screen of the system
o change the password after signing into the system
o see the actual status of the inventory, for example, whether a particular item can be obtained
or not etc
o search for a item by typing the original letters
o enter the items bought by a customer and create a bill for the same (the expenses will have a
unique sale identification, date, time, item/quantity/price information etc)
o cancel the created bill, in case of error within entering the details, and make a new one
o take back again an already sold product that is not satisfactory to the client (the shop allows
that) and produce a receipt for the similar
o inform the inventory office manager about the items that are not accessible, so that they can
be stocked
o inform the sales manager regarding any exceptions (such being an item is being purchased,
however it is not available in the system)
o get help about the program on how to use the different features from the system
2. The inventory manager should be able to
o login to the system/change his username and password after logging in and so on
o check the status from the inventory
o see the information from sales people about goods that are not available and need being
kept in the inventory (Riabov and Higgs, 2010).
o validate the inventory against the income done in the previous day (whether the items that
are sold plus the change in the inventory to the corresponding items match etc)
for a departmental store.
The Project has the following modules
o Sales Manager
o Sales Person
o Inventory Manager
o Admin
1. A sales person should be able to
o login to the system through the preliminary screen of the system
o change the password after signing into the system
o see the actual status of the inventory, for example, whether a particular item can be obtained
or not etc
o search for a item by typing the original letters
o enter the items bought by a customer and create a bill for the same (the expenses will have a
unique sale identification, date, time, item/quantity/price information etc)
o cancel the created bill, in case of error within entering the details, and make a new one
o take back again an already sold product that is not satisfactory to the client (the shop allows
that) and produce a receipt for the similar
o inform the inventory office manager about the items that are not accessible, so that they can
be stocked
o inform the sales manager regarding any exceptions (such being an item is being purchased,
however it is not available in the system)
o get help about the program on how to use the different features from the system
2. The inventory manager should be able to
o login to the system/change his username and password after logging in and so on
o check the status from the inventory
o see the information from sales people about goods that are not available and need being
kept in the inventory (Riabov and Higgs, 2010).
o validate the inventory against the income done in the previous day (whether the items that
are sold plus the change in the inventory to the corresponding items match etc)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

o generate inventory reports in the items category-wise, price-wise and so forth
o generate inventory-trends (like precisely how is coffee powder commodity changing over
the month)
3. The sales manager should be able to
o check how many bills have already been generated in the day thus far
o check how much money is transacted in the day so far
o check how many bills have been baulked so far in the day(due to help wrong entry by the
gross sales persons)
o check how many objects have been returned so far inside day
4. The administrator should be able to
o login to the system and transform his password after visiting in
o add new people to the system
o add brand-new items/categories to the inventory
SOFTWARE USED:
Language : C#.NET
Technologies : Microsoft.NET, ASP.NET, ADO.NET
Database : MS SQL SERVER 2005
IDE : Visual Studio 2008
Operating System : Microsoft Windows XP or Later Version
HARDWARE USED:
1. Processor : Pentium IV
2. Hard Disk : 2GB
3. RAM : 512MB
Use Case Diagram
o generate inventory-trends (like precisely how is coffee powder commodity changing over
the month)
3. The sales manager should be able to
o check how many bills have already been generated in the day thus far
o check how much money is transacted in the day so far
o check how many bills have been baulked so far in the day(due to help wrong entry by the
gross sales persons)
o check how many objects have been returned so far inside day
4. The administrator should be able to
o login to the system and transform his password after visiting in
o add new people to the system
o add brand-new items/categories to the inventory
SOFTWARE USED:
Language : C#.NET
Technologies : Microsoft.NET, ASP.NET, ADO.NET
Database : MS SQL SERVER 2005
IDE : Visual Studio 2008
Operating System : Microsoft Windows XP or Later Version
HARDWARE USED:
1. Processor : Pentium IV
2. Hard Disk : 2GB
3. RAM : 512MB
Use Case Diagram

Use Case Diagram
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Use Case Diagram
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Conclusion
Shop Management System has some flows as well as limitation due to different specifications and time
constrain. Because application will be used on the computer systems so the end user must have the
fundamental knowledge of the computers. Presently only one item’ information could be enter in the
system at a time. The consumer has to enter information several items. The system currently offers only
one combination of username and password qualifications, every user has to discuss same credentials.
The lookup function only supports research using ID number. The person has to get ID amount of
customer, sales, purchase, item, or supplier to search inside the system.
Shop Management System has some flows as well as limitation due to different specifications and time
constrain. Because application will be used on the computer systems so the end user must have the
fundamental knowledge of the computers. Presently only one item’ information could be enter in the
system at a time. The consumer has to enter information several items. The system currently offers only
one combination of username and password qualifications, every user has to discuss same credentials.
The lookup function only supports research using ID number. The person has to get ID amount of
customer, sales, purchase, item, or supplier to search inside the system.

REFERENCES
Bailie, F., Blank, G., Murray, K. and Rajaravivarma, R., 2003. Java visualization using BlueJ. Journal of Computing
Sciences in Colleges, 18(3), pp.175-176.
Bailie, F., Courtney, M. and Tuohy, S., 2003. Objects First-does it work?. Journal of Computing Sciences in
Colleges, 19(2), pp.303-305.
Janke, E., Brune, P. and Wagner, S., 2015, May. Does outside-in teaching improve the learning of object-oriented
programming?. In Proceedings of the 37th International Conference on Software Engineering-Volume 2 (pp. 408-
417). IEEE Press.
Bruegge, B., 1992, October. Teaching an industry-oriented software engineering course. In SEI Conference on
Software Engineering Education (pp. 63-87). Springer, Berlin, Heidelberg.
Cohen, B., 1987. The education of the information systems engineer. Electronics and Power, 33(3), pp.203-205.
Cooper, S., Dann, W. and Pausch, R., 2003, February. Teaching objects-first in introductory computer science.
In ACM SIGCSE Bulletin (Vol. 35, No. 1, pp. 191-195). ACM.
Corbin, J. and Strauss, A., 2008. Basics of qualitative research: Techniques and procedures for developing grounded
theory.
Riabov, V.V. and Higgs, B.J., 2010. Software tools and virtual labs in online computer-science classes. Learning
management system technologies and software solutions for online teaching: Tools and applications, p.332.
Jadud, M.C., 2005. A first look at novice compilation behaviour using BlueJ. Computer Science Education, 15(1),
pp.25-40.
Bailie, F., Blank, G., Murray, K. and Rajaravivarma, R., 2003. Java visualization using BlueJ. Journal of Computing
Sciences in Colleges, 18(3), pp.175-176.
Bailie, F., Courtney, M. and Tuohy, S., 2003. Objects First-does it work?. Journal of Computing Sciences in
Colleges, 19(2), pp.303-305.
Janke, E., Brune, P. and Wagner, S., 2015, May. Does outside-in teaching improve the learning of object-oriented
programming?. In Proceedings of the 37th International Conference on Software Engineering-Volume 2 (pp. 408-
417). IEEE Press.
Bruegge, B., 1992, October. Teaching an industry-oriented software engineering course. In SEI Conference on
Software Engineering Education (pp. 63-87). Springer, Berlin, Heidelberg.
Cohen, B., 1987. The education of the information systems engineer. Electronics and Power, 33(3), pp.203-205.
Cooper, S., Dann, W. and Pausch, R., 2003, February. Teaching objects-first in introductory computer science.
In ACM SIGCSE Bulletin (Vol. 35, No. 1, pp. 191-195). ACM.
Corbin, J. and Strauss, A., 2008. Basics of qualitative research: Techniques and procedures for developing grounded
theory.
Riabov, V.V. and Higgs, B.J., 2010. Software tools and virtual labs in online computer-science classes. Learning
management system technologies and software solutions for online teaching: Tools and applications, p.332.
Jadud, M.C., 2005. A first look at novice compilation behaviour using BlueJ. Computer Science Education, 15(1),
pp.25-40.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 12
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2026 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.




