25.4k views
4 votes
A program will load the web page with a shopping cart if the user clicks on the cart icon, and it will load the sales items if the user clicks on a dollar sign. Which structure controls this part of the program?

A) Selection
B) Iteration
C) Recursion
D) Sequence

User LMokrane
by
8.3k points

1 Answer

3 votes

Final answer:

The structure controlling the program's response to user clicks on a cart icon or dollar sign is called Selection.

Step-by-step explanation:

The structure that controls this part of the program when a user clicks on a cart icon or a dollar sign is known as Selection. The selection structure, often implemented as an if-else or switch-case statement, enables a program to decide which path of execution to follow based on user input or other conditions.

For example, if the user clicks on the cart icon, the program will use a selection statement to choose to load the shopping cart web page. Conversely, if the user clicks on the dollar sign, the same structure will direct the program to load the web page showing sales items.

User Rob Earlam
by
8.5k points