answer.
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
Virty [35]
2 years ago
15

NOTE: in mathematics, the square root of a negative number is not real; in C therefore, passing such a value to the square root

function is an error. Given a double variable named areaOfSquare write the necessary code to read in a value, the area of some square, into areaOfSquare and print out the length of the side of that square. HOWEVER: if any value read in is not valid input, just print the message "INVALID".
Computers and Technology
1 answer:
Tanya [424]2 years ago
4 0

Answer:

# include<math.h>

# include<stdlib.h>

# include<stdio.h>

int main()

{

    int choice;

    double area;

    printf("Enter the area of Square:");

    scanf("%lf", &area);

    printf("Enter the choice: 1, 2:");

    scanf("%d", &choice);

    switch(choice)

    {

        case 1:if(area<0.00)

                        {

                        printf(" INVALID");

                        break;

                        }

                      else

                        {

                        printf("side of square: %lf", sqrt(area));

                        break;

                       }

                       break;

        case 2: break;

    }

return 0;

}

Explanation:

Here, if area is less than 0 then invalid message is printed out. And if area is more than 0 then the sqrt is calculated and the side of a square length is being printed out. And that is what is required. lf is for double. And math.h is included to make use of the sqrt function.

You might be interested in
Write a sequence of statements that create a file named "greeting" and write a single line consisting of "Hello, World!" to that
tia_tia [17]

Answer:

The solution code is written in Python 3 as below:

  1. outfile = open("greeting.txt", "w")
  2. outfile.write("Hello World")
  3. outfile.close()

Explanation:

To create a simple text file in Python, we can use Python built-in function, <em>open()</em>. There are two parameters needed for the open() function,

  1. the file name and
  2. a single keyword "w". "w" denote "write". This keyword will tell our program to create a file if the file doesn't exist.

The statement <em>open("greeting.txt", "w")</em> will create a text file named "<em>greeting.txt</em>" (Line 1)

To fill up the content in the greeting.txt, we use <em>write()</em> method. Just include the content string as the argument of the <em>write()</em> method. (Line 2)

At last, we use <em>close() </em>method to close the opened file,<em> outfile</em>. This will release the system resource from the<em> outfile.</em>

4 0
2 years ago
Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
kolbaska11 [484]

Answer: Decoupling action of the process address space refers to the physical memory of the device getting decoupled to provide  address translation in automatic way. The benefit of this method is as follows:-

  • Faster starting up of the program
  • The physical address space gets managed on its own
  • Helps in execution of large program when the main memory of the machine is of  smaller size in comparison with program

7 0
2 years ago
rite a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original main
weeeeeb [17]

Complete Question

Write a method so that the main() code below can be replaced by the simpler code that calls method calcMiles() traveled.

Original main():

public class Calcmiles {

public static void main(string [] args) {

double milesperhour = 70.0;

double minutestraveled = 100.0;

double hourstraveled;

double milestraveled;

hourstraveled = minutestraveled / 60.0;

milestraveled = hourstraveled * milesperhour;

System.out.println("miles: " + milestraveled); } }

Answer:

import java.util.Scanner;

public class CalcMiles

{

public double CalculateMiles (double miles, double minutes)

{ //Method CalculateMiles defined above

//Declare required variables.

double hours = 0.0;

double mile = 0.0;

//Calculate the hours travelled and miles travelled.

hours = minutes / 60.0;

mile = hours * miles;

//The total miles travelled in return.

return mile;

}

public static void main(String [] args)

{

double milesPerHour = 70.0;

double minsTravelled = 100.0;

CalculateMiles timetraveles = new CalculateMiles();

System.out.println("Miles: " + timetravels.CalculateMiles(milesPerHour, minsTraveled));

}

}

//End of Program

//Program was written in Java

//Comments are used to explain some lines

Read more on Brainly.com - brainly.com/question/9409412#readmore

7 0
2 years ago
If the__________ is/are out of balance, the driver will feel a pounding or shaking through the steering wheel.
RUDIKE [14]
If the VEHICLE(S) is/are out of balance, the driver will feel a pounding or shaking through the steering wheel.
This pounding <span>shortens the life of all the suspension components and hence</span> <span>produce an uneven tire wear and  which eventually </span>will<span> increase fuel consumption.</span>

4 0
2 years ago
Read 2 more answers
Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
mixas84 [53]

The windows tool of weapon of choice that Carrie will use to troubleshoot the server is Powershell. All those GUI consoles built by Microsoft for Windows, by default, execute Powershell commands behind the scenes. Every possible thing that Carrie can do with the physical server can easily be accessible through Powershell's command line interface

Further Explanation

I would honestly say that there are a few available tools that Carrie can use, but the best tool is the inbuilt Windows Powershell. As Powershell continues to extend its purpose and usefulness, Microsoft, on the other hand, continues to use Powershell's capability to develop more cmdlets for products like Windows Servers.

Everything that can be done in a GUI environment can be done in Powershell. Carrie should be able to use Powershell to run things more efficiently from the command line without stepping a foot on the physical server. She will only need to access the server from her desk remotely, run a few commands, and that is it. Powershell command line is so powerful; it carries with it every troubleshooting pack that you can think about.

Learn More

brainly.com/question/10178399

brainly.com/question/10338479

#LearnWithBrainly

5 0
2 years ago
Read 2 more answers
Other questions:
  • The elements in a string type array will be initialized to ____.?
    10·1 answer
  • Python comes with ________ functions that have been already prewritten for the programmer.
    5·1 answer
  • A patient asks her doctor to send a copy of her records to another medical office. However, the records are not transmitted beca
    10·2 answers
  • Adrian has decided to create a website to catalog all the books he has in his personal library. He wants to store this informati
    11·2 answers
  • Database management systems are expected to handle binary relationships but not unary and ternary relationships.'
    7·1 answer
  • Drag each tile to the correct box.
    12·1 answer
  • (a) Show how to use (the Boolean formula satisfiability program) satisfiable num (and substitute) to find a satisfying assignmen
    9·1 answer
  • Information systems cannot solve some business problems. Give three examples and explain why technology cannot help.
    11·1 answer
  • Discussion Question 10: A bank in California has 13 branches spread throughout northern California , each with its own minicompu
    13·1 answer
  • ) A byte is used to represent a single character in the computer ______<br> true or false?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!