Week 3 DQ 1 - are separate paths to follow if the data is...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
What are the similarities and differences between single alternative structures, dual alternative structures, and case structures? Provide an example of one of the three control structures using pseudocode. Try to provide an example that has not already been posted. The similarities and differences between single alternative structures, dual alternative structures, and case structures are, a condition must be met to carry out the path taken based on what is input. A single-alternative structure ("If Then" statement) and a dual- alternative structure ("If Then-Else") are used for a true or false type of program. But in a dual- alternative structure there
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: are separate paths to follow if the data is true or false. Case structure's (Multiple-alternative structures"), have more than two block statements and when a condition is met it will follow that path and pass the other two block statements. Dual-Alternative Structure Input Cost Write "Enter total revenue:" Input Revenue Set Amount = Revenue - Cost If Amount > 0 Then Set Profit = Amount Write "The profit is $" + Profit Else Set Loss = -Amount Write "The loss is $" + Loss End If...
View Full Document

This note was uploaded on 03/08/2012 for the course CGS 3269 taught by Professor Staff during the Fall '08 term at University of Central Florida.

Ask a homework question - tutors are online