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
VikaD [51]
3 years ago
13

A and B have same output or not? A B x=0 x=0 do do x<3 x=x+1 x=x+1 print x print x while x<3 while

Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
6 0

Answer:

A and B have different output:

A output will be 1

B output will be 123

Explanation:

A

X = 0

do x < 3

x = x+1

print x

while

B

X = 0

do x = x+ 1

print x

while x < 3

For statement A the condition statement which suppose to be after "while" is not set therefore the value of x will be printed.

For statement B the condition statement is set "x < 3" in front of "while" thereby result in iteration until the condition is false.

Statement A output will be 1

Statement B output will be 123

You might be interested in
Columns can be added to a page in the page layout tab in the blank grouping
ZanzabumX [31]

Answer:

Page Setup Grouping.

Explanation:

In Microsoft Word, Columns break up the page into, at max, 13 columns, and at minumum, 2. The way you go about doing this is

  1. Go to the Layout Tab
  2. Go to the Page setup Grouping
  3. Click on the Columns Action
  4. In the Dialog Box, choose either from one of the presents, or custom make your own column settings.
  5. Click Okay
  6. Done!

3 0
3 years ago
Read 2 more answers
Cell division is called:
Blizzard [7]

Answer:

Mitosis

Explanation:

6 0
3 years ago
Given parameters b and h which stand for the base and the height of an isosceles triangle (i.e., a triangle that has two equal s
schepotkina [342]

Answer:

The area of the triangle is calculated as thus:

Area = 0.5 * b * h

To calculate the perimeter of the triangle, the measurement of the slant height has to be derived;

Let s represent the slant height;

Dividing the triangle into 2 gives a right angled triangle;

The slant height, s is calculated using Pythagoras theorem as thus

s = \sqrt{b^2 + h^2}

The perimeter of the triangle is then calculated as thus;

Perimeter = s + s + b

Perimeter = \sqrt{b^2 + h^2} + \sqrt{b^2 + h^2} +b

Perimeter = 2\sqrt{b^2 + h^2} + b

For the volume of the cone,

when the triangle is spin, the base of the triangle forms the diameter of the cone;

Volume = \frac{1}{3} \pi * r^2 * h

Where r = \frac{1}{2} * diameter

So, r = \frac{1}{2}b

So, Volume = \frac{1}{3} \pi * (\frac{b}{2})^2 * h

Base on the above illustrations, the program is as follows;

#include<iostream>

#include<cmath>

using namespace std;

void CalcArea(double b, double h)

{

//Calculate Area

double Area = 0.5 * b * h;

//Print Area

cout<<"Area = "<<Area<<endl;

}

void CalcPerimeter(double b, double h)

{

//Calculate Perimeter

double Perimeter = 2 * sqrt(pow(h,2)+pow((0.5 * b),2)) + b;

//Print Perimeter

cout<<"Perimeter = "<<Perimeter<<endl;

}

void CalcVolume(double b, double h)

{

//Calculate Volume

double Volume = (1.0/3.0) * (22.0/7.0) * pow((0.5 * b),2) * h;

//Print Volume

cout<<"Volume = "<<Volume<<endl;

}

int main()

{

double b, h;

//Prompt User for input

cout<<"Base: ";

cin>>b;

cout<<"Height: ";

cin>>h;

//Call CalcVolume function

CalcVolume(b,h);

//Call CalcArea function

CalcArea(b,h);

//Call CalcPerimeter function

CalcPerimeter(b,h);

 

return 0;

}

3 0
3 years ago
Thanks for help evreybody
ladessa [460]

Answer:

np

Explanation:

7 0
3 years ago
Read 2 more answers
Write a program that performs a simulation to estimate the probability of rolling five of a kind in a single toss of five six-si
VikaD [51]

Answer:

import random

def probability_five_of_a_kind(num_trials):

   sums = 0

   for _ in range(num_trials):

       roll_1 = random.randrange(1,6, 1)

       roll_2 = random.randrange(1,6, 1)

       roll_3 = random.randrange(1,6, 1)

       roll_4 = random.randrange(1,6, 1)

       roll_5 = random.randrange(1,6, 1)

       collection = roll_1 + roll_2 + roll_3 + roll_4 + roll_5

       if collection == 5:

           sums += 1

   prob = round(sums/7776, 8)

   print(f"The probability_five_of_a_kind is {prob}")

   

probability_five_of_a_kind(100)

probability_five_of_a_kind(10000)

probability_five_of_a_kind(1000000)

Explanation:

The random package of the python language is used to select an integer value from the range of one to six representing the sides of a die. All six rolls are randomized and the sum. If the sum is equal to 5, the sums counter is incremented. At the end of the loop, the sum is divided by the five dices events (which is 6^5 = 7776).

8 0
2 years ago
Other questions:
  • Which statements describe the advantages of using XML?
    12·2 answers
  • What software is typically used for larger systems?
    11·1 answer
  • A cybersecurity analyst is currently investigating a server outage. The analyst has discovered the following value was entered f
    9·1 answer
  • You want to boot a linux system into singer user mode/ what options might you add to a linux kernel options list in a boot loade
    9·1 answer
  • __________ are hosted on dedicated computers known as 'web servers'.​
    8·2 answers
  • How has the global marketplace used emerging technologies to expand businesses
    14·1 answer
  • How have these advances in-home technology changed the role of technicians in our society?
    10·1 answer
  • In windows 10, where would you save the template so it is available in the available templates list in backstage view?.
    10·1 answer
  • What is a program that includes a function parameter capable of doing?
    8·1 answer
  • PLEASE HELP ME
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!