1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
notsponge [240]
3 years ago
15

Which of the following about if statement is true? A. The condition is a Boolean expression B. A Boolean expression is something

the computer can test whether it is true or not C. If statement is used to implement selection control structure D. All of the above are true
Computers and Technology
1 answer:
lianna [129]3 years ago
3 0

Answer:

D) All the above are true

Explanation:

consider this code snippet

<em>int age =17;</em>

<em>if(age<18){</em>

<em>  cout<<"You are young"<<endln;</em>

<em>}</em>

<em>else{</em>

<em>  cout<<"You are an adult"<<endln;</em>

<em>}</em>

From this code snippet we see the use of an if statement which is followed by the condition age<18. We can see that this condition can only be true or false that is boolean (Fulfils option A in the question) And we know that a boolean expression is something the computer can test whether it is true or not (fulfills option B). Then finally we have used it to implement a selection control with the combination of an else branch. So all of the options are true

You might be interested in
How do you determine latitude using an astrolabe?
miv72 [106K]
This was really useful in determining one's location during the times when technology wasn't that advanced yet. First is that it depends as to what time of the day is it being used. If used at day, most probably at high noon, the altitude of the sun would be measured and recorded and/or remembered. Most of the times, the latitude is determined during the day since it is much easier. At night, a star of known declination will be substituted to the sun. Most of the times, the North Star is used. Then, an almanac will be utilized to determine the declination of the Sun or the star, depending on which was used. After which, the formula is applied, which is latitude = 90 degrees - measured altitude +declination.
3 0
3 years ago
Write only in C, not C++.
yawa3891 [41]

Answer:

#include <iostream>

using namespace std;

int main() {

  int k;

double d;

string s;

cin >> k >> d >> s;

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s; }

                                                                   

Explanation:

k is int type variable that stores integer values.

d is double type variable that stores real number.

s is string type variable that stores word.

cin statement is used to take input from user. cin takes an integer, a real number and a word from user. The user first enters an integer value, then a real number and then a small word as input.

cout statement is used to display the output on the screen. cout displays the value of k, d and s which entered by user.

First the values of k, d and s are displayed in reverse order. This means the word is displayed first, then the real number and then the integer separated again by EXACTLY one space from each other. " " used to represent a single space.

Then next line \n is used to produce a new line.

So in the next line values of k, d and s are displayed in original order (the integer , the real, and the word), separated again by EXACTLY one space from each other.

The program along with the output is attached.

7 0
3 years ago
4.3 mini programs AP computer science
allochka39001 [22]

1.

name = input("Enter your name: ")

num1 = int(input("Hello "+name+ ", enter an integer: "))

num2 = int(input(name+", enter another integer: "))

try:

   if num1 % num2 == 0:

       print("The first number is divisible by the second number")

   else:

       print("The first number is not divisible by the second number")

except ZeroDivisionError:

   print("The first number is not divisible by the second number")

try:

   if num2 % num1 == 0:

       print("The second number is divisible by the first number")

   else:

       print("The second number is not divisible by the first number")

except ZeroDivisionError:

   print("The second number is not divisible by the first number")

2.

import random, math

num1 = float(input("Enter a small decimal number: "))

num2 = float(input("Enter a large decimal number: "))

r = round(random.uniform(num1, num2), 2)

print("The volume of a sphere with radius " + str(r) + " is " + str(round(((4 / 3) * math.pi * (r ** 3)), 2)))

I hope this helps!

8 0
3 years ago
Which menu would most likely allow you to choose a font A.file B.Edit C.format D.insert​
Ksivusya [100]

Answer:

D

Explanation:

7 0
2 years ago
To create a multiple-table form based on the âmanyâ table, tap or click the ____ button on the create tab to create a form in la
Archy [21]
Click on the blank form button. 
3 0
3 years ago
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • Nadia would like to find text in her current document that differentiates CompanyABC from companyabc. Which option should she us
    8·2 answers
  • Add is a function that accepts two int parameters and returns their sum.
    8·1 answer
  • The sun produces energy by the process of nuclear: <br><br> A.fission <br> B.fusion
    7·2 answers
  • Computer hardware without computer software is useless while computer software without computer hardware is meaningless. Discuss
    10·1 answer
  • A network consists of 10 computers, all running windows 7 professional. one computer acts as a file server and serves up data to
    6·1 answer
  • How do media and networks interact? A. Networks and media work in exactly the same way. B. Media are connected to networks that
    8·1 answer
  • Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also initiates a Telnet session with
    13·1 answer
  • Write a program that outputs a subtraction practice problem for a student, outputting the larger random number
    12·1 answer
  • If an electric circuit has 30ohms and 10amps. How many volts the battery voltmeter should read?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!