answersLogoWhite

0


Best Answer

floating-point variable cost

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a pseudocode statement that declares the variable cost so it can hold real numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you design an If-Then statement or a flowchart with a single alternative decision structure that assigns 20 to the variable y and 40 to the variable z if the variable x is greater than 100?

Design an If-Then statement (or a flowchart with a single alternative decision structure) that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that assigns 0 to the variable b if the variable a is less than 10. Otherwise, it should assign 99 to the variable b. The following pseudocode contains several nested If-Then-Else statements. Unfortunately, it was written without proper alignment and indentation. Rewrite the code and use the proper conventions of alignment and indentation. If score < 60 Then Display "Your grade is F." Else If score < 70 Then Display "Your grade is D." Else If score < 80 Then Display "Your grade is C." Else If score < 90 Then Display "Your grade is B." Else Display "Your grade is A." Design nested decision structures that perform the following: If amount1 is greater than 10 and amount2 is less than 100, display the greater of amount1 and amount2. Rewrite the following If-Then-Else If statement as a Select Case statement. If selection == 1 Then Display "You selected A." Else If selection == 2 Then Display "You selected 2." Else If selection == 3 Then Display "You selected 3." Else If selection == 4 Then Display "You selected 4." Else Display "Not good with numbers, eh?" End If Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that displays “Speed is normal” if the speed variable is within the range of 24 to 56. If speed holds a value outside this range, display “Speed is abnormal.” Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that determines whether the points variable is outside the range of 9 to 51. If the variable holds a value outside this range it should display “Invalid points.” Otherwise, it should display “Valid points.” Design a case structure that tests the month variable and does the following: If the month variable is set to 1, it displays “January has 31 days.” If the month variable is set to 2, it displays “February has 28 days.” If the month variable is set to 3, it displays “March has 31 days.” If the month variable is set to anything else, it displays “Invalid selection.” Write an If-Then statement that sets the variable hours to 10 when the flag variable minimum is set. End If End If End If End If


What is a variable that accumulates the sum of several numbers?

A total is a variable that accumulates the sum of several numbers. Answer is based on C How to Program (6th Edition)


What variable keeps a running total?

The answer is "an accumulator." "A running total is a sum of numbers that ACCUMULATES with each iteration of a loop. The variable used to keep the running total is called an accumulator." It can be any variable you want! It could be total, tot, etc. Here is an example: total = 0 randoms = [random.randRange(0, 99999)] * 100 # Creates a list of 100 random numbers for number in randoms: total += number print(total) # Py3k print statement. Sample output: 35460


Can you add a variable with a number?

Yes, IF the variable has been declared, has a value, and is of a numerical type such that your addition operator can perform the operation on the number and the value of that type variable. The compiler or interpreter will look up the variable's value, substitute it for the variable, and perform the addition just as if your statement used two numbers. First example: If your number is an integer and your variable is of type real, almost any addition operator can successfully add the two. Second example: If your number is a real and your variable is a character type (with a value, say, of "Smith"), the addition will obviously fail. In many languages, however, variables of type Boolean may be handled arithmetically, as the value True equals 1 and False is zero.


How do you find the greatest of three numbers using ternery operator?

Compare the first two numbers with the ternary operator. Store the result in a temporary variable. Compare the temporary variable with the third number, again using the ternary operator.

Related questions

Develop an algorithm to display all prime numbers from 2 to 100 Give both the pseudocode version and the flowchart version Convert your pseudocode into a Java program?

Develop an algorithm to display all prime numbers from 2 to 100. Give both the pseudocode version and the flowchart version. Convert your pseudocode into a Java program.


How do you know when a number is not a solution of an equation?

When you put the number in place of the variable (like maybe the 'x' or the 'y') wherever the variable occurs in the equation, and the statement you get out of all the numbers you have is not true, then you know the number is not a solution.


What variable dicribes the numbers?

the variable that decribes the numbers are reallt tricky to understand but the variable is the dependent variable! (pretty sure but not completely) hope it help you!


Pseudocode for subtraction of two binary numbers?

start read a read b c=a-b print c end


What is the math term for a number a variable or a product of numbers and variables?

Term- a number, a variable, or a product of numbers and variables.


What does it mean if the mean is doubled but the standard deviation is the same?

The second set of numbers are less variable; the coefficient of variation is halved. The second set of numbers are less variable; the coefficient of variation is halved. The second set of numbers are less variable; the coefficient of variation is halved. The second set of numbers are less variable; the coefficient of variation is halved.


Is this statement true All real numbers are irrational numbers?

No. The statement is wrong. It does not hold water.


What is a statement irrational numbers?

Irrational numbers are real numbers.


What is the meaning of the word variable?

Variable means something that changes. X, for example, is a variable, as it can be many different numbers.


Does a variable expression consists only of numbers?

An algebraic expression can have a mixture of numbers and variables, but it does not contain an equals sign.


Design an If-Then statement (or a flowchart with a single alternative decision structure) that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10?

Design an If-Then statement (or a flowchart with a single alternative decision structure) that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that assigns 0 to the variable b if the variable a is less than 10. Otherwise, it should assign 99 to the variable b. The following pseudocode contains several nested If-Then-Else statements. Unfortunately, it was written without proper alignment and indentation. Rewrite the code and use the proper conventions of alignment and indentation. If score < 60 Then Display "Your grade is F." Else If score < 70 Then Display "Your grade is D." Else If score < 80 Then Display "Your grade is C." Else If score < 90 Then Display "Your grade is B." Else Display "Your grade is A." Design nested decision structures that perform the following: If amount1 is greater than 10 and amount2 is less than 100, display the greater of amount1 and amount2. Rewrite the following If-Then-Else If statement as a Select Case statement. If selection == 1 Then Display "You selected A." Else If selection == 2 Then Display "You selected 2." Else If selection == 3 Then Display "You selected 3." Else If selection == 4 Then Display "You selected 4." Else Display "Not good with numbers, eh?" End If Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that displays “Speed is normal” if the speed variable is within the range of 24 to 56. If speed holds a value outside this range, display “Speed is abnormal.” Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that determines whether the points variable is outside the range of 9 to 51. If the variable holds a value outside this range it should display “Invalid points.” Otherwise, it should display “Valid points.” Design a case structure that tests the month variable and does the following: If the month variable is set to 1, it displays “January has 31 days.” If the month variable is set to 2, it displays “February has 28 days.” If the month variable is set to 3, it displays “March has 31 days.” If the month variable is set to anything else, it displays “Invalid selection.” Write an If-Then statement that sets the variable hours to 10 when the flag variable minimum is set. End If End If End If End If


How do you design an If-Then statement or a flowchart with a single alternative decision structure that assigns 20 to the variable y and 40 to the variable z if the variable x is greater than 100?

Design an If-Then statement (or a flowchart with a single alternative decision structure) that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that assigns 0 to the variable b if the variable a is less than 10. Otherwise, it should assign 99 to the variable b. The following pseudocode contains several nested If-Then-Else statements. Unfortunately, it was written without proper alignment and indentation. Rewrite the code and use the proper conventions of alignment and indentation. If score < 60 Then Display "Your grade is F." Else If score < 70 Then Display "Your grade is D." Else If score < 80 Then Display "Your grade is C." Else If score < 90 Then Display "Your grade is B." Else Display "Your grade is A." Design nested decision structures that perform the following: If amount1 is greater than 10 and amount2 is less than 100, display the greater of amount1 and amount2. Rewrite the following If-Then-Else If statement as a Select Case statement. If selection == 1 Then Display "You selected A." Else If selection == 2 Then Display "You selected 2." Else If selection == 3 Then Display "You selected 3." Else If selection == 4 Then Display "You selected 4." Else Display "Not good with numbers, eh?" End If Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that displays “Speed is normal” if the speed variable is within the range of 24 to 56. If speed holds a value outside this range, display “Speed is abnormal.” Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that determines whether the points variable is outside the range of 9 to 51. If the variable holds a value outside this range it should display “Invalid points.” Otherwise, it should display “Valid points.” Design a case structure that tests the month variable and does the following: If the month variable is set to 1, it displays “January has 31 days.” If the month variable is set to 2, it displays “February has 28 days.” If the month variable is set to 3, it displays “March has 31 days.” If the month variable is set to anything else, it displays “Invalid selection.” Write an If-Then statement that sets the variable hours to 10 when the flag variable minimum is set. End If End If End If End If