Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 Examine the pseudocode sample provided, and explain what it does line by line. Click here to access the sample. Note that this example

Part 1

Examine the pseudocode sample provided, and explain what it does line by line.

Click here to access the sample. Note that this example is built on top of the one provided in week 2.

Unit 3 Pseudocode Sample Description: This logic applies a discount on an item unless the discounted price is less than the whole sale price Program: applyDiscount

Create variable productPrice as double Create variable discount as double Create variable wholesalePrice as double Create variable discountedPrice as double productPrice = get value from user input discount = get value from user input wholesalePrice = get value from user input discountedPrice = productPrice * (1 - discount) if (discountedPrice < wholesalePrice) discountedPrice = wholesalePrice end if Display discountedPrice End program

Line of code Please insert your explanation

Description: This logic applies a discount on an item unless ths discounted price is less than the whole sale price ?

Program: applyDiscount ?

Create variable productPrice as double ?

Create variable discount as double ?

create variable wholesalePrice as double ?

Create variable discountedPrice as double ?

productPrice = get value from user input ?

discount = get value from user input ?

wholesalePrice = get value from user input ?

discountedPrice = productPrice * (1 - discount) ?

if (discountedPrice < wholesalePrice)

discountedPrice = wholesalePrice

end if

Display discountedPrice

End program

Part 2

* Present a solution using pseudocode similar to what you saw in part 1.

* Identify the logic needed to select a payment option, and get payment details.

* The logic needs to capture the payment option from the user.

* Two options should be available for the user to select from:

* Electronic check with routing number and account number

* Credit card with account number, expiration date and CVV code

* The logic should check the selected option using a decision-making statement and provide the corresponding statements to capture the payment information based on the selection.

Insert your Pseudocode here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

Discuss the steps used in strategic planning.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago