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

Consider the following C++ program in which the statements are in the incorrect order. Rearrange the statements so that itprompt

s the user to input the radius of a circle and outputs the area and circumference of the circle-#include {int.main()cout << "Enter the radius: ':cin >> radius;cout << endl;double radius;double area;using namespace std;return 0;cout << "Area = ' << area << endl;area - PI * radius * radius;
Computers and Technology
1 answer:
choli [55]3 years ago
8 0

Answer:

The correct program to this question can be given as:

Program:

//header file

#include<iostream> //include header file

using namespace std;

//main

int main() //defining method main

{

double radius,area=0; //defining variables

double PI=3.14; //defining variable PI and assign value

cout <<"Enter the radius: "; //message

cin >> radius; //input value by user

area = PI * radius * radius; //formula to calculate area

cout << "Area: "<< area << endl; //print area

return 0;

}

Output:

Enter the radius: 3.0

Area: 28.26

Explanation:

In the above program code, a header file is included. In the next line, the main method is defined, which contain three double type variable that is "radius, area, and PI".

  • The radius variable is used to take input by the user, and the area variable is to calculate the area of the circle, and the PI is used to hold a constant value, which is "3.14".
  • After taking user input in radius variable the area variable has used the formula of the circle, which calculates a value and in the last print, the function uses "cout", that prints area variable value.
You might be interested in
1. Extract title Write a function extract_title that takes one parameter, the filename of a GenBank formatted file, and returns
trapecia [35]

Answer:

def extract_title(file):

   import re

   a =''

   with open(file,'r') as file:

       for line in file:

           a += line

       m = re.search("^(TITLE)(.*?)(JOURNAL)", a, re.M + re.S)

       print(m.groups()[1])

extract_title('new.txt')

Explanation:

The programming language used is python 3.

The function is first defined and the regular expression module is imported.

A variable is initialized to an empty string that will hold the content of the GenBank formatted file.

The file is opened and every line in the file is assigned to the string variable. The WITH statement allows files to be closed automatically.

Regular expression is used to capture all the files between TITLE and JOURNAL in a group.

The group is printed and the function is called.

I have attached a picture of the code in action.

6 0
3 years ago
In class, we discussed static local variables in C. Answereach question below; if necessary, find and consult a reference on the
alexira [117]

Answer:

(a) scope: function, lifetime: duration of the function

(b) scope: function, lifetime: duration of the program

(c) scope: global (all modules),  lifetime: duration of the program

(d) scope: module (file), lifetime: duration of the program

6 0
3 years ago
If I make a Zoom Meeting, would you join it?
boyakko [2]

Most likely, yeah lol.

3 0
3 years ago
Read 2 more answers
The master system database stores a database template that is used as a blueprint when creating a new user database.
Novay_Z [31]
<span>An attribute in a relation of a database that serves as the primary key of another relation in the same database is called a</span>
6 0
2 years ago
The mean life of a certain computer hard disk in continual use is 8 years. (a) How long a warranty should be offered if the vend
Allushta [10]

Answer:

a) 0.843 years

b) 1.785 years

Explanation:

See attached pictures for detailed explanation.

4 0
3 years ago
Other questions:
  • Once you select select a crop boundary, you can no
    15·1 answer
  • IT investments can lead to developing IT capabilities and dynamic IT competencies, which can lead to achieving the following six
    5·1 answer
  • Which of the following best explains what the profit motive pushes producers to do
    9·1 answer
  • Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
    13·1 answer
  • _____ interviews rely on scenarios and reflections to evaluate an applicant’s skill set.
    9·2 answers
  • In this unit, you developed your skills at coding in Python. In this lab, you will put those skills to work by creating a progra
    8·2 answers
  • What are general purpose computer and special purpose computer?​
    10·2 answers
  • Which protocol is often used in conjunction with ipsec to provide a remote access client vpn with user authentication?
    13·1 answer
  • Are programs that understand physics and/or hardware embedded? for example, one that uses finite-element methods to predict flui
    7·1 answer
  • A technique that was developed to determine whether a machine could or could not demonstrate the artificial intelligence known a
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!