Paper Example Undergraduate 931 words

Visual Basic Programming and Algorithm

Last reviewed: February 7, 2016 ~5 min read

Algorithm and Visual Basic Programming

Jerry Feingold is the owners of a small restaurant who intends to develop a program that will assist him calculating the total amount used to tip a waiter at the restaurant. The program is designed to deduct any liquor charge from the overall total bill, followed by calculating the tip by using a percentage of the remainder. Finally, the program should be designed to display the tip output on the screen. Moreover, the paper desk checks the solution of the algorithms using $20 as the charge of liquor, $85 as the total bill, and 20% for the tip percentage. Finally, the paper desk-checks the program using $35 for the total bill, 15% as the tip percentage and $0 for the liquor charge.

Explanation of the Solution

The first solution to the problem is to display the input and output of the scenario, algorithm, and desk check to ensure that the algorithm is correct. The most important components that can be employed to solve the problem is to identify the input and output of the program. (Zak, 2013). The output is very critical to solving a problem, and the inputs are the items to achieve this goal. The followings are the input and output of the problem:

Output: tip

Input: total bill tip percentage liquor charge

Plan the Algorithm

This step reveals that algorithms used for the problem-solving process, which transforms the input of the problem into an output. The goal of the algorithm is to describe an action that the computer will perform. The algorithms start by entering the inputs of the items in order to calculate the output of the item. Thus, the algorithms display the output of the item. The paper makes algorithms be consistency by referring to the input and output of the items. The algorithms of the case scenario is as follows:

Algorithm

1. enter the liquor charge, total bill, as well as tip percentage

2. calculate the tip by deducting the overall liquor charge from the total bill and then multiply the remainder of the bill by the tip percentage

3. display the tip

The algorithms are similar to pseudocode that consists of short English statements. The statement is referred as coded because it resembles a programming language. However, the computer cannot understand the pseudocode, the computer programmers still use the pseudocode to assist them planning an algorithm that allows them using the human-readable language to develop a code for a programming language.

2.2: Flowchart of the Solution

Start

enter the liquor charge, total bill, as well as tip percentage calculate the tip by deducting the overall liquor charge from the total bill, and then multiply the remainder of the bill by the tip percentage tip = (total bill --liquor charge) x tip percentage display tip

Stop

Desk-Check Table

total bill liquor charge tip percentage tip

Data set 1

85

20

0.2

13

Data set 2

35

0

0.15

5.25

The calculations for Data Set 1 and 2 are as follows

Data Set 1: tip = (total bill --liquor charge) x tip percentage tip = (85-20) x 0.2

tip = (65) x 0.2

tip=13

Data Set 2: tip = (total bill --liquor charge) x tip percentage tip = (35-0) x 0.15

tip = (35) x 0.15

tip=5.25.

3)

3.1: Description of the Problem

In this scenario, Jerry will charge his credit cards to collect the total bill and tip. The algorithms are presented to display the amount charged for the credit card for the appropriate tip. The Desk-check of the algorithm uses $50 for the total bill, $5 for the liquor charge where 20% as the tip percentage. The paper also desk-checks the algorithms using $15 for the total bill, $0 for the liquor charge, and 15% as the tip percentages.

3.2: Explanation of the solution

This task assists in finding the solution to the problem to display the input and output of the algorithm, scenario, and desk check to deliver a correct algorithm. The input and output are the most important components to solve the problem, which assists in achieving the solution to the problem. The followings are the output and input of the problem:

Output: tip

Output: total amount charged

Input: total bill tip percentage liquor charge

3.3: Plan the Algorithm

This step discusses the algorithms to solve the problem that transforms the input to deliver an output. The algorithm describes an action, which the computer performs. The algorithms for this problem display the output of the items.

The algorithms of the problem is as follows:

Algorithm

1. Charge the total bill and tip with Jerry's credit card

2. enter the liquor charge, total bill, as well as tip percentage

3. calculate the tip by deducting the overall liquor charge from the total bill, and then multiply the remainder of the bill by the tip percentage

You’re 81% through this paper. Sign up to read the full paper.

Sign Up Now — Instant Access Already a member? Log in
130,000+ paper examples AI writing assistant Citation generator Cancel anytime
Cite This Paper
PaperDue. (2016). Visual Basic Programming and Algorithm. PaperDue. https://www.paperdue.com/essay/visual-basic-programming-and-algorithm-2155787

Always verify citation format against your institution’s current style guide requirements.