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
g100num [7]
3 years ago
6

What is true about the following code segment:

Computers and Technology
1 answer:
dimaraw [331]3 years ago
3 0

Answer:

Hi!

The correct answer is D. Depending on the value of x, either all three of the print statements will execute or none of the statements will execute

Explanation:

The IF statement checks the value of x and executes the next lines of code inside of the IF condition in case that is TRUE, else it skips up without execution of the lines inside the IF condition.

For example:

  var x = 5;

 if(x==5) { <em>// if 5=5? -> true -> executes the lines inside the If statement.</em>

   print ("Is 5")

   print ("Is Still 5")

   print ("Third 5")

}

You might be interested in
Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number
sineoko [7]

Answer:

// using c++ language

#include "stdafx.h";

#include <iostream>

#include<cmath>

using namespace std;

//start

int main()

{

 //Declaration of variables in the program

 double start_organisms;

 double daily_increase;

 int days;

 double updated_organisms;

 //The user enters the number of organisms as desired

 cout << "Enter the starting number of organisms: ";

 cin >> start_organisms;

 //Validating input data

 while (start_organisms < 2)

 {

     cout << "The starting number of organisms must be at least 2.\n";

     cout << "Enter the starting number of organisms: ";

     cin >> start_organisms;

 }

 //The user enters daily input, here's where we apply the 5.2% given in question

 cout << "Enter the daily population increase: ";

 cin>> daily_increase;

 //Validating the increase

 while (daily_increase < 0)

 {

     cout << "The average daily population increase must be a positive value.\n ";

     cout << "Enter the daily population increase: ";

     cin >> daily_increase;

 }

 //The user enters number of days

 cout << "Enter the number of days: ";

 cin >> days;

 //Validating the number of days

 while (days<1)

 {

     cout << "The number of days must be at least 1.\n";

     cout << "Enter the number of days: ";

     cin >> days;

 }

 

 //Final calculation and display of results based on formulas

 for (int i = 0; i < days; i++)

 {

     updated_organisms = start_organisms + (daily_increase*start_organisms);

     cout << "On day " << i + 1 << " the population size was " << round(updated_organisms)<<"."<<"\n";

     

     start_organisms = updated_organisms;

 }

 system("pause");

  return 0;

//end

}

Explanation:

6 0
3 years ago
In which phase of website design does the designer create a mock-up aimed at the target use
alexdok [17]

Answer:

The answer is design.

Explanation:

I know this because based off the notes it states that "the designer can use a model or mock-up to illustrate the look and feel, to help gain a better understanding of the necessary elements and structures.

3 0
2 years ago
How does electricity work in phones?
kati45 [8]
Great Question! So the plug will go into the wall and electricity will hit the cord and power through the cord into the charger (Cordless) Now if you talking mobile phones such as iPhones. The battery powers wire and hardware to power your little mobile phone! Hope this helps.
8 0
3 years ago
list three quantitative characteristic properties of water explain why they are considered characteristic
tia_tia [17]

Answer:

The three quantitative characteristic properties of water is explained below in detail.

Explanation:

The three quantitative components of water incorporate the following:

1.Freezing point:

The water has a freezing point of 0 degrees Celsius.

2. Boiling point:

The water has a boiling point of 100 degrees Celsius.

3. Melting point:

The melting point of ice is 0 degrees Celsius.

These properties are all uncommon to water. Being uncommon means that these characteristics are only noticeable in water; hence, they can be beneficial in recognizing such a substance.

5 0
3 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
cupoosta [38]

Answer:

Following are the program in java language:

import java.util.*; // import package

public class Main

{

public static void main(String[] args) // main method

{

 int num; // integer variable declaration

 double r; //double varaible declaration

 char ch; // char variable declaration

Scanner scnr=new Scanner(System.in); // creating the instance of scanner

 System.out.println("Enter the string:");

 String str=scnr.nextLine(); // reda string by user

System.out.println("Enter the integer value:");

 num=scnr.nextInt(); // Read integer value by the user

 System.out.println("Enter the Double value:");

 r=scnr.nextDouble(); // read double value by user

 System.out.println("Enter the character value:");

 ch= scnr.next().charAt(0); // read character by user

 System.out.print(num + " ,"); // display them in a single line

 System.out.print( " " +r +" ,");//dislpay in a single line  

  System.out.print( " " +ch +",");//dislpay in a single line

 System.out.print(" " +str);//dislpay in a single line

}

}

Output:

Enter the string:

ram

Enter the integer value:

34

Enter the Double value:

45.789

Enter the character value:

r

34 , 45.789 , r, ram

Explanation:

Following are the description of program

  • Read the integer ,string,char,double value by the user by using scanner class in "num","str","ch" and "r" variable respectively
  • Print that value in a single line separated by comma by System.out.println statement.

7 0
3 years ago
Other questions:
  • A technician is tasked to implement a wireless router that will have the fastest data transfer speed at 5 GHz frequency. Which o
    11·1 answer
  • True or false words spelling and grammar check is always %100
    7·2 answers
  • Write a program that tells what coins to give out for any amount of change from 1
    6·1 answer
  • Mary from sales is asking about the plan to implement Salesforce.com's application. You explain to her that you are in the proce
    9·1 answer
  • Kiara is using her software's graphic formats to create a line graph. As she
    9·2 answers
  • Importance of taking correct body measurement....
    15·1 answer
  • 3.19 LAB: Seasons In C++ Write a program that takes a date as input and outputs the date's season. The input is a string to repr
    15·1 answer
  • Suppose you present a project and your supervisor comments that the graphics need to be a higher quality and suggests you replac
    9·2 answers
  • Please help im not good at computer class ​
    10·2 answers
  • I need a solution for this problem asap.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!