Write a pseudocode If-Then statement that assigns 0.2 to commission if sales is greater than or equal to 10,000.

Short Answer

Expert verified
Based on the given step-by-step solution, answer the following question: **Question:** Write a pseudocode for an If-Then statement that assigns a value of 0.2 to the commission variable if the sales variable is greater than or equal to 10,000. **Answer:** ```pseudocode DECLARE sales, commission sales = 12000 IF sales >= 10000 THEN commission = 0.2 END IF ```

Step by step solution

01

1. Initialize the variables

First, we need to indicate the variables we will be working with. In this case, we have the 'sales' and 'commission' variables. ``` DECLARE sales, commission ```
02

2. Set values for testing

For testing purposes, we will temporarily set a value for the 'sales' variable. After writing the entire pseudocode, this line can be removed. ``` sales = 12000 ```
03

3. Write the If-Then statement

Next, we write the If-Then statement to compare the value of the 'sales' variable with the given condition (greater than or equal to 10,000). If the condition is true, then assign 0.2 to the 'commission' variable. ``` IF sales >= 10000 THEN commission = 0.2 END IF ```
04

4. Pseudocode overview

Here's the complete pseudocode with all the steps, including the testing value for the 'sales' variable, which can be changed or removed as needed. ``` DECLARE sales, commission sales = 12000 IF sales >= 10000 THEN commission = 0.2 END IF ```

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free