Procedural Programming OOPS Assignment Help-TGAH

This sample solution of procedural programming on oops assignment help guide you about how to do procedural programming with the help of C++ language.

Introduction

The report is consisting of the overall details of the program developed to manage the sales and purchase details of the shop or any other organization. The program is developed in C++ programming language which is an object oriented programming language. With the help of this program user can easily maintain and calculate their total cost and price of the sales and purchase both.

Task 1

1).Identify the program inputs, outputs and function needed.

The developed program helps us to calculate the total sale price of the purchase, purchase cost, purchase price, net sale price, etc. To calculate these all program needs to various inputs by the user, that is given below:

Program input:

  • Username and password to use the program.
  • Sale price and cost to calculate the net sale price.
  • Purchase price and transaction cost to display the overall purchase price.

When the user inputted these things to calculate the net sales price or overall purchase price, the program output the result by calculating these value.[Also Read: – OOPS Programming Assignment Help]

Program output

  • Net sale price (Sale price – sale cost).
  • Overall purchase (purchase price + purchase transaction cost).
  • When user quit the program, a report will be display which includes the total sales, total purchase, and overall balance of the cash flow for the day.

Function needed

To calculate these values like net sale price and overall purchase, the program needs following function:

  • ‘main()’ to execute the program.
  • Boolean function (bool) to return the Boolean value
  • ‘ValidateUsernameAndPassword()’ to validate the username and password inputted by the user.
  • ‘processTransaction()’, ‘sales_transaction.clear()’, ‘purchase_transaction.clear()’, ‘sales_transaction.push_back(net)’ to calculate the net sa les and purchase transaction.
  • ‘out.close()’ to close the program.
  • ‘sales_transaction.size()’, ‘sales_transaction.begin()’, and ‘sales_transaction.end()’ to show the total sales details report of the purchase when the program is to be quit.
  • ‘purchase_transaction.size()’, ‘purchase_transaction.begin()’, and ‘purchase_transaction.end()’ to show the total purchase details report of the day when the program is to be quit.
  • ‘ProcessTransaction()’ to show the overall balance of the cash flow for the day.

2). Design the program using a Structure Chart or Structured English (or any other standard design method) paying particular attention to loops and selection statements

The flowchart or structure chart of the program is given below

Procedural Programming OOPS Assignment Help-TGAH

Figure 1 flowchart

3). Create a Test Plan and Test Data to test your program using both valid and invalid data.

We are created a test plan and list of test data by using both valid and invalid data. According to the test plan we enter the both valid and invalid data in the program and analyze the output of the program. [Also Read: – Understand object oriented design concepts

The test data for this test plan is given below

Valid data

  • Input valid user name (martin) and password (happy).
  • Input positive number in sale cost, price, or purchase cost, price.
  • Input the sale price > sale cost
  • Input capital character S, P, H and Q for (S)ales, (P)urchase, (H)elp and (Q)uit.

Invalid data

  • Input invalid user name and password.
  • Input negative number in cost, price, or purchase cost, price.
  • Input the sale price < sale cost.
  • Input small character s, p, h and q for (S)ales, (P)urchase, (H)elp and (Q)uit.

Task 2

1). Code your program in C++ following your prepared design.2c) what will be implications for its stakeholders?

We code our program in C++ object oriented programming language according to our prepared design. The screenshot of the code of whole program given below:

Procedural Programming OOPS Assignment Help-TGAH

image 2

Procedural Programming OOPS Assignment Help-TGAH

image 3

Procedural Programming OOPS Assignment Help-TGAH

image 4

Procedural Programming OOPS Assignment Help-TGAH

image 5

Implication for its stakeholder

There are various implications for its stakeholders. The implications are given below:

  • Active stakeholder participation: The fundamental philosophy is that the developer, staffs, and the support people must work closely together on the regular basis. The implication is that they must see one other as important as the stakeholders and actively seek to work together.
  • Automated testing: The program is written in quality code. The program is tested as test-driven development and behavior-driven development test approaches so that the user or stakeholders enjoy the higher level of quality. The program provides a sufficient quality to its stakeholders before release into production.
  • Integrated configuration management: The programs provide the integrated approach to configuration management. The development team not only applies the configuration management at the solution level as is customary, they also consider the production configuration issues between their solution and infrastructure of the users or stakeholders. They can configure their full management like sales management, purchase management, total sales transaction, total purchase transaction, etc.
  • Integrated change management: Change management basically is the act of ensuring successfully and meaningful evolution of the infrastructure to better support the organization or users need. This program is fully supportive for all the needs of the user. This program is developed with the integrated change management where the development teams work closely with the operations teams to understand the implications of the any technology changes at the organization level. This approach depends on the earlier practice of the active stakeholder’s participation, integrated configuration management and the automated testing.
  • Integrated deploying planning: from the development point of view the deployment plan has always required the interaction with the operation staff of organizations. The program was continuously tested before the implementation of the program so that the program meets to the needs of stakeholders.

Also it is easy to use and cost effective for the stakeholders. They can use it for their various work like stoke or inventory purchase management and shop or organizations sales and purchase management. [Also Read: – PHP Assignment Help

Task 3

1).Test your program following your prepared test plan and show the results using screen shots

We have test the program according to our test plan. The screenshot of the different test step which we mention in our test data is given below:

Procedural Programming OOPS Assignment Help-TGAH

image 7

When input valid username and password

Procedural Programming OOPS Assignment Help-TGAH

image 8

When Input positive number in sale cost and price

Procedural Programming OOPS Assignment Help-TGAH

image 9

When Input negative number in sale cost and price

Procedural Programming OOPS Assignment Help-TGAH

image 10

When input sale price> sale cost

Procedural Programming OOPS Assignment Help-TGAH

image 11

When input sale price< sale cost

Online Assignment

image 12

When input capital character S, P, H or Q for (S)ales, (P)urchase, (H)elp or (Q)uit

Online Assignment

image 13

When input small character s, p, h or q for (S)ales, (P)urchase, (H)elp or (Q)uit

C Programming Assignment Help

image 14

2). Analyze actual test results against expected results to identify discrepancies

We have test the program according to our test plan and analyze the test results against the expected results to identify the discrepancies. The actual and expected test results shown in the table given below: [Also Read: – Educational App Development Android Assignment Help

Test case Actual result Expected Result
Input valid user name and password Successfully logged in and welcome message will shown on the screen Yes, successfully logged in and welcome message shown on the screen

C Programming Assignment Help

image 15

Test case Actual result Expected Result
Input invalid user name and password Authentication failed, enter valid username and password message will be shown on the screen Yes, authentication failed, enter valid username and password message shown on the screen

C Programming Assignment Help

image 16

Test case Actual result Expected Result
Input positive value in sale cost and price Value accepted and process for the next Yes, the value is accepted and processed for the next

C Programming Assignment Help

image 17

Test case Actual result Expected Result
Input negative value in the sale cost and price Enter a valid price message will show on the screen Yes, input valid price message shown on the screen

C Programming Assignment Help

image 18

Test case Actual result Expected Result
Input sale price > sale cost Value will be accepted and process for next Yes, value is accepted and processed for next

C Programming Assignment Help

image 19

Test case Actual result Expected Result
Input sale price< sale cost Cost cannot be greater than the price message will be shown Yes, cost cannot be greater than price message shown

C Programming Assignment Help

image 20

Test case Actual result Expected Result
Input capital character S for (S)ales Welcome to sale and Enter sale price output is shown Yes, welcome to sale and enter sale price output is shown

C Programming Assignment Help

image 21

Test case Actual result Expected Result
Input small character s for (S)ales Invalid option message will be show Yes, invalid option message will be shown

C Programming Assignment Help

image 22

3). Evaluate your program and make recommendations for improvements following feedback from your tutor

Evaluation

The program is developed in C++ object oriented programming language. The quality of code is good and easy to understand. Users can easily run this program in C++ software by importing the program in the software. It is easily compile and run in the window operating system. User can easily manage their sales and purchase with the help of this program. They can also calculate their total profit and total transactions of sales and purchase. The output interface of the program is very simple and anyone can use and understand this very easily. They only have to enter username and password to access this program and then if they want to calculate the sales transaction only has to input S for sales and same with the (P)urchase, (H)elp and (Q)uit. [Also Read: – Entity Relationship Diagram Database Assignment Help

Improvements

The developed program needs some improvements to perform better than existing. The program only shows the value which we enter in sale price and cost not show net sale price or overall purchase cost in the sales and purchase section of the program.

The program also needs a user interface like a desktop application so that it is more easy to use for the users. It may further developed in java so that we can add more features and attractive interface in the program.[Also Read: – ERD Database Management System Assignment

Task 4

1).Create onscreen help to assist the users of the program

When the user run the program, the program will output the result “Enter your username:” after this user have to input his username ‘martin’ and then press enter. When the user press enter, the program output the result “Enter your password” then user have to enter the password “happy” and press enter. After pressing the enter button, user will welcome with a welcome message “welcome to our program” and a menu shows below the welcome message as following:

ERD Database Management System Assignment

image 23

After this user have to select their choice either (S)ale, (P)urchase, (H)elp or (Q)uit. User has to input S for sale, P for purchase, H for help and Q for quit and then press enter. When the user enter ‘S’ then a “Welcome to sales” message will shown and “Enter sales price” below on the welcome message. Then user has to enter the sale price of the product and then press enter. After this program ask for the “Enter sale cost.” After this menu item will shown on the screen and then user has to make their selection as P, H or Q.Top Grade Assignment Help

image 24

When the user enter P then “Welcome to purchase” message will be shown and below the welcome message “Enter purchase price” then user has to input the purchase price and press enter. After this program output the result as “Enter purchase cost,” then user has to enter the purchase cost and press enter. After this the menu will be shown.

Top Grade Assignment Help

image 25

After this user have to make another selection for help or quit. When user enter H then “Welcome to help” message will be shown on the screen and if the user enter Q then a “Goodbye..” message will output by the program and below this the detail summary of no. of sales and purchase transaction will  be shown on the screen

Top Grade Assignment Help

image 26

Task 5

Create program documentation for the support and maintenance of the program

We create a brief document for this program which includes the detail of structure of the program, variables used in the program and their data types, etc. [Also Read: – Cipher Algorithm Networking Assignment Help

Programming structure

The structure of any program is the collection of variable types grouped together. In this program we use the simple object oriented programming structure which is used in the C++ program.

First of all we include the header files in the program, which is shown below:

Top Grade Assignment Help

image 27

After including the header files, we use the standard C++ library “namespace std;” The namespace declaration in the program allows all the elements of program in the std namespace to be accessed in an unqualified manner.

Top Grade Assignment Help

image 28

After defining the namespace std, we define the global variable in the program. The global variables are mainly defined the outside of all the functions used in the program, generally on the top of the program after header file and namespace std. It will hold the value which is entered

Top Grade Assignment Help

image 29

After this, we use the helper function in the program to authenticate the user. It returns true if the user enter valid username and password otherwise return false. It stores the Boolean type of data

Top Grade Assignment Help

image 30

After this, we declare the local variables in the program which is mainly declared inside the function. The local variables are used only by the statement, it don’t know the functions outside their own.

Top Grade Assignment Help

image 31

After this, we use simple input and output keyword which is commonly used in the program Cin and Cout respectively. We apply various conditions for input and output data. if the entered data by the user is true than the program output the result which is mentioned in the conditions used in the program

Top Grade Assignment Help

image 32

After doing all this, at last we declare the return 0; statement. Basically the main function is necessary and used for every program to execute the program and it is declared as the int main, so it has to return a value. So the return value of the main function in the program considered as the exit status of the application and program. [Also Read: – IT Programming Database Assignment Help

Variables used in the program and their data types

We use the various variables in the program to store the different types of data. The name of the variable, their data types, and their purpose of use in the program is given below:

Global variables

  • vector<int> sales_transaction; :- The data type of this variable is int (integer), it means it holds the integer value of data for the sales transactions.
  • vector<int> purchase_transaction; :- This is also a integer type of variable which is used to holds the integer value of all the purchase transaction.

Local variables

  • string str; :- This is a string type of variable, which stores the string value or data. This is used to store the username value entered by the user.
  • string str2; :- This is also a string type of variable which stores the string value which is entered in the password section of the program by the user.
  • Int price;, Int cost;, and Int net; :- These three variables are integer type of variables which stores the integer value entered for the price, cost and net sale price in the program respectively.

Annotated listing of the program

The annotated listing of the program is given and described below:

Line1 – line 6: The line 1-line 6 includes the header file of the program as given below:

Top Grade Assignment Help

image 33

Line 8: In line 8 of the program we used the namespace variable std, which allow all the elements in the program to be accessed in unqualified manner.

Top Grade Assignment Help

image 34

Line 17- line 18: In line no. 17-18 we declare the global variable for the sale and purchase transactions which holds the value of sales and purchase in the program.

Top Grade Assignment Help

image 35

Line 31: In line no. 31 we used the helper function which authenticates the user. It returns true if the user enters the correct username and password otherwise returns false.

Technical Assignment Help

image 36

Line 40-line 41: In line no. 40-41 we declare the local variable in the program, which stores the value entered by user for username and password. It stores the string type of data.

Technical Assignment Help

image 37

Line 49: In line no. 49, we use the ‘cout’ which is  defined by C++ stream object to output the result ‘’Enter your username:”

Technical Assignment Help

image 38

Line 56: In line no. 56, we use the ‘cin’ which is defined by C++ stream object to input the value

Line 57- line 73: In line no. 57 to 73, we apply the if-else condition. If the username = martin than it return true and authenticate the user else it return the false and out the result invalid username and same for the password.

Technical Assignment Help

image 39

Line 80-line 98: In line no. 80 to 98, we use the helper function, which is used to print the menu and also ask for the sales or purchase according to his selection and print the summary when user quit the program.

Technical Assignment Help

image 40

Line 100-line 201: From line no 100 to 201, we applied the if-else condition for the different section of menu such as sales, purchase, help and quit. When works or calls in the program according to the user selection.

Technical Assignment Help

image 41

Technical Assignment Help

image 42

Technical Assignment Help

image 43

Line no. 208: In line no. 208, we use the main function for execution of program.

Technical Assignment Help

image 44

Line 210-line 222: In line no. 210 to 222, we apply the conditions which specifies the session for the logged in user. If the bool is_authenticated= false; it means the user logged in session is expire and require a new session and while true it means the session is continue. [Also Read: – Cipher Algorithm Networking Assignment Help

Line 223: In line no. 223, we declare the return 0; statement, which is hold the integer value that is return by the main function after execution of the program and run the program.

Technical Assignment Help

image 45

Conclusion

The report provides the full coding description of the program. It also provides the user manual for the users who use it. After reading this report anyone can able to understand the program and can easily use the program for their work. The program is providing a very easy output interface so that anyone can easily understand what the program asks for input. This is also good for the security purpose, because the username and password field authenticate the user before access or use the program so that the program is also secure from the unauthorized users.

References

Programiz.com. (2016). Flowchart In Programming. [online] Available at: http://www.programiz.com/article/flowchart-programming [Accessed 16 Jun. 2016].

Cplusplus.com. (2016). Structure of a program – C++ Tutorials. [online] Available at: http://www.cplusplus.com/doc/tutorial/program_structure/ [Accessed 16 Jun. 2016].

Top Grade Assignment provide technical assignment writing service based on case study requirements in affordable prices and we are providing most flexible online assignment writing help, so book your Assignment with us, order now

top grade assignment

About the Author

Alice