Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( algorithms , C - Overview, selection statements ) Provide short Answers only for 2 1 to 2 5 . Rewrite the if statement below

(algorithms, C-Overview, selection statements)
Provide short Answers only for 21 to 25.
Rewrite the if statement below using only the relational
operator in all conditions. Assume that the value of score
is between 0 and 100 inclusive.
if (score 90)
else if (score 80)
else
paiatf("C
"):
What do these statements display?
a. if (1212)
grintf("less"):
else
pointft" not less");
output: not less
b. var1=2512:
var2=1500;1500
if (var1var2)
else
p6iotft"less or equal");
briotfte"greater than");
output: greater than
Write an if statement that might be used to compute and
display the average of a set of n numbers whose sum is stored
in variable total. This average should be found only if n is
greater than 0; otherwise, an error message should be
displayed.
if (n>0)
printf("Average: d?
",(total/n));
else
printf("Error: n0?
");
Write a C programming expression to test for each of the
following relationships.
a. age is from 18 to 21 inclusive.
b. water is less than 1.5 and also greater than 0.1.
c. year is divisible by 4.(Hint: Use 2a.)
d. speed is not greater than 55.
e.y is greater than x and less than z.
f.w is either equal to 6 or not greater than 3.
Write C assignment statements for the following:
a. Assign a value of 0 to between if n is less than -k or
greater than +k; otherwise, assign 1.
b. Assign a value of 1 to divisor if digit is a divisor of
num; otherwise, assign a value of 0.
c. Assign a value of 1 to lowercase if > is a lowercase
letter; otherwise, assign a value of 0.
Algorithms and Programming:
Assume we want to write an interactive C program that uses
selection statements to compute the area of a square (area =
side * side) or a circle (area = PI * radius* radius) after
prompting the user to choose the first character of the chosen
figure name S or C) lowercase letters also included. Answer
the following questions:
6.1 What are the input and output variables?
6.2 Draw the corresponding Raptor flowchart to represent this
algorithm (provide a screenshot only in the same word
document)
6.3 Write the complete c program to represent this algorithm
(copy the source code also in the same word document with
screenshots of the program output).
6.4 What gof command(s) will be used to compile, link, and
execute this program?
image text in transcribed

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

Advances In Database Technology Edbt 88 International Conference On Extending Database Technology Venice Italy March 14 18 1988 Proceedings Lncs 303

Authors: Joachim W. Schmidt ,Stefano Ceri ,Michele Missikoff

1988th Edition

3540190740, 978-3540190745

More Books

Students also viewed these Databases questions

Question

What is likely to be the most credible exchange rate system?

Answered: 1 week ago

Question

a. What are S, F, and P?

Answered: 1 week ago

Question

find the percent of a number c code

Answered: 1 week ago