Problem: Write the Python code of a program called ComputeSquare that asks the user to enter the length of the side of the square and displays the area and perimeter of the square. Check that the side length is greater than zero, and if it is not, display an informative error message to the user. ​

Answers

Answer 1
Solution :

The given problem is solved in Python.

def ComputeSquare():

side = float(input('Enter the side of the square: '))

if side > 0:

perimeter = 4 * side

area = side * side

print('Perimeter of the square is:',

perimeter, 'unit.')

print('Area of the square is:', area, 'square unit.')

else:

print('Invalid input.')

ComputeSquare()

Explanation :-

In this program, we create a function ComputeSquare() to calculate the perimeter and area of a square.

The function asks the user to enter the side of the square. The side is then stored in a variable.

Now, we check whether the side is greater than 0 or not using if-else statement.

If the condition is true, the perimeter and area is calculated which is displayed using print() statement.

If the condition is false, the else blocks executes printing the error message.

Refer to the attachment for output.

Problem: Write The Python Code Of A Program Called ComputeSquare That Asks The User To Enter The Length

Related Questions

App designers should avoid using auto-detection of user location because consumers resent the invasion of privacy. a. true b. false

Answers

Answer:

Explanation:

true because they may have a customer that is death and can't hear you and you don't know sign language so you need highlighted words for them to read.but if they are blind you need to do the sign language on their hand.

Answer:True

Explanation:

_____ is human thinking and problem-solving by a machine, including learning, reasoning, and self-correction.

Moore’s law
Moore’s law

cloud computing
cloud computing

biocomputing
biocomputing

artificial intelligence.
(Answer is artificial intelligence.)

Answers

yea, artificial intelligence :/

Answer:

It artificial intelligence / AI

Explanation:

I just took the test
EDG 2022

04. Suppose a computer program needs to sort a list of student records in ascending order
according to last name. The program language determines sort order by using the
individual ASCII number representations of the characters in each name.
If the initial list contains the following names. Which of the following lists represents
the name order after executing the sorting procedure?
["Tom Smith","Joe Schnook", "Kathy Bones","Jill Brewer"]
(A) ["Smith Tom", "Schnook Joe","Bones Kathy","Brewer Jill"]
(B) ["Joe Schnook","Tom Smith","Jill Brewer", "Kathy Bones"]
(C) ["Jill Brewer","Joe Schnook", "Kathy Bones", "Tom Smith")
(D) ["Kathy Bones","Jill Brewer","Joe Schnook","Tom Smith"]

Answers

Answer:

D) ["Kathy Bones", "Jill Brewer", "Joe Schnook", "Tom Smith"]

Explanation:

The context of the problem explains a computer program that sorts names in "ascending order" (A to Z) since the ASCII table has capital A start a lower number and it increases from there to capital Z.

Notice how the attached file, which is a portion of the ASCII table, shows that letters after A are also higher in decimal value than the previous letter.

With this in mind, we know that all this program does is sort by last name alphabetical order. From there, just sort the given names using that same criteria, last name alphabetical order, and the correct answer is determined.

Please put "Brainliest" on my answer if it helped you out!

If you want to learn more about this subject, you can search:

- ASCII Table

- Lists in Programming

- Sorting Procedures

The correct list that represents the name order after executing the sorting procedure is (D) ["Kathy Bones", "Jill Brewer", "Joe Schnook"," Tom Smith"]. Therefore, option D is correct.

What is a computer program?

A computer program is a set of instructions that tells a computer what to do to perform a specific task or solve a problem.

Since the program sorts the names in ascending order according to last name, it will consider the last name first and then sort the names alphabetically based on the ASCII value of the characters in each last name.

So, in the initial list, "Bones" comes before "Brewer", which comes before "Schnook", which comes before "Smith". Therefore, after sorting, the correct order of the names would be: "Kathy Bones", "Jill Brewer", "Joe Schnook", and "Tom Smith". Thus, option D is correct.

Learn more about computer programs, here:

https://brainly.com/question/3397678

#SPJ2

if you bet and another person bets do you get the money you bet and the money the other person bets?
example : say you bet on a computer game and your sister bets $5 and you bet $10 that you will win. Do you get the $10 and the $5 if you win from your sister or just the $5?​

Answers

Answer:

I believe you would get both because since you both did a bet and you won, that would mean you should automatically get both of what yall put down.

Explanation:

I think that's what should happen but I'm not sure though.

This is an example of what type of formula?
=(D1+D17)

Answers

The type of formula that is represented by the given example =(D1+D17) in excel is known as; The SUM Formula function

What are functions in excel?

There are different ypes of formula functions in excel such as;

SUMCOUNTCOUNTAIFTRIMMAX & MIN

Now, in this question, the formula we are given is =(D1+D17) and the example it represents is the SUM formula function.

Read more about Excel Functions at; https://brainly.com/question/14042837

scientific name of computer ?

Answers

Answer:

supercomputer. (redirected from scientific computer)

Explanation:

hope it will help you..

Scientific name of computer supercomputer.

What are Supercomputer?

Supercomputing and other computing methods are sometimes used interchangeably. Yet, there are times when the synonyms aren't clear. To assist clarify some similarities and differences between various computer types, here are some common analogies.

While supercomputing typically refers to the process of complex and massive calculations used by supercomputers, high-performance computing (HPC) is the utilization of several supercomputers to execute difficult and huge computations.

Supercomputers are often known as parallel computers since they can perform parallel processing. Parallel processing is the simultaneous use of many Processors to solve a single calculation.

Therefore, Scientific name of computer supercomputer.

To learn more about Supercomputer, refer to the link:

https://brainly.com/question/30227199

#SPJ6

what is the importance of saving a web page

Answers

Answer:

to see it later and remember it

What should you do first to best use your personal goals as a means for a promotion?
O research how your company offers promotions
O show professional behavior at all times
O set both short and long-term personal goals
O make sure some goals are only for personal growth

Answers

Answer:

C. Set both short and long-term personal goals.

Explanation:

This would be the most professional option.

How to send large video files without losing quality

Answers

Answer:

Explanation:

The videos can be compressed, easily, with a free program called HandBrake

you can get handbrake here: https://handbrake.fr/

Once you compress them using this program, then you can send them through any messaging service as long as the service takes the file under whatever file size rules it has.


Googul Drive works to send the compressed video well.

The software that requests mail delivery from the mail server to an Internet device is known as mail ____ software.

Answers

The software that requests mail delivery from the mail server to an Internet device is known as mail client software.

Explanation:

Mail client software is a form of communication in which electronic messages are created and transferred between two or multiple devices connected to a network series or stream.

In a single processor system running Windows, when the kernel accesses a global resource, it A) uses spinlocks. B) masks all interrupts. C) uses a dispatcher object. D) atomic integers.

Answers

In a single processor system running Windows, If the kernel accesses a global resource, it masks all interrupts.

What does it implies to mask an interrupt?

An internal switch setting is known to often controls if an interrupt can be worked on or not.

The act of a Maskable interrupt is known to be when a hardware is said to interrupt and as such, it can disabled or left like that by the instructions of CPU.

Learn more about Windows from

https://brainly.com/question/25243683

Michael bought a game he will play on his computer. The scenes in the game move smoothly, but they seem a little blurry. Which two devices--either or both-might be causing the issue?

keyboard

hard

disk

monitor

mouse

graphics card


Answers

The devices that may be causing the game to appear blurry are the graphics card and the monitor.

What is a graphics card?

The graphics card is a hardware device used in computers to improve their performance when playing videos, video games or other programs that have high graphic demand.

What is a monitor?

Monitor refers to the computer screen. This can have very varied characteristics such as size, range of colors, pixels, among others that can affect the image.

According to the above, either of these two devices can alter the image of the video game, making it look much more blurred.

Learn more about computers in: https://brainly.com/question/21080395

Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give your eyes a short break every half hour.

Answers

Screen reading for extended periods can cause a syndrome known as the computer vision syndrome

Computer vision Syndrome

What is computer vision Syndrome?

the computer syndrome is characterised by eye discomfort and fatigue, dry eye, blurry vision, and headaches, glare, etc. Uncorrected vision problems are a major cause. it is recommended to stay off the computer for at least thirty minutes to minimise the effects

Learn more about Computer vision Syndrome here:

https://brainly.com/question/8114244

HURRY IT'S URGENT
How would you create a variable named myDog and give it the value "Karel"?

options:

var myDog = "Karel":


var myDog = Karel


var myDog = "Karel";


var my Dog = "Karel"

What JavaScript function do we use to print out a message to the user?

options:

printLn()


print()


print


println();

Answers

The variable myDog and the value "Karel" are illustrations of assigning values to variable

The statement that creates the variable is (c). var myDog = "Karel";The function to print in JavaScript is (b) print()

How to create the variable?

To create a variable in JavaScript, you have to add the keyword "var".

Given that the variable name is myDog; So, we have:

var myDog

The value of the variable is "Karel".

Hence, the assignment statement is: C. var myDog = "Karel";

Function to print in JavaScript

To print in JavaScript, we make use of the print() statement

Hence, the function to print in JavaScript is (b) print()

Read more about JavaScript at:

https://brainly.com/question/16698901

What problem does computer science solve in dance?

Answers

Answer:

Computer science, your able to make websites that might have videos on teaching you dance techniques.

B. State True or False: 1. 'Date within' option allows you to search an email within a specified date range.​

Answers

Answer + Explanation:

his topic describes the email and document properties that you can search for in email items in Exchange Online and documents stored on SharePoint and OneDrive for Business sites by using the Content Search feature in the Security & Compliance Center. You can also use the *-Compliance Search cmdlets in Security & Compliance Center PowerShell to search for these properties

Please have a great day <3

How is the development of SaaS related to cloud computing?

Answers

Answer:

SaaS cloud allows it to take advantage of the efficiencies of resource pooling and cost effective pricing models of cloud- based infrastructure

What are different social phenomenas are you aware of that used part of a social movement, change, or cause

Answers

Answer:

Social change in the broadest sense is any change in social relations. Viewed this way, social change is an ever-present phenomenon in any society.

Explanation:

Cyber criminals who infiltrate systems and collect data for illegal resale are called _____.

Answers

Answer:

Cash-out fraudsters

Explanation:

What is a critical consideration on using cloud-based file sharing and storage applications.

Answers

Answer:

Determine if the software or service is authorized

Explanation:

:)

how do I fix when it hits the second session it skips scanf..
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
main() {
double first, second;
while(1){
printf(" Calculator\n");
printf("\n 7 8 9 / \n 4 5 6 x \n 1 2 3 - \nEnter operator: ");
char op;
scanf("%c" ,&op); //entering operators such as + - \ *
printf("Enter two operands:");
scanf("%lf %lf", &first, &second); //entering operands such as 1 2 5 8 12 414
switch (op) { // printing the math
case '+'://if its +
printf("%.1lf + %.1lf = %lf\n\n", first, second, first + second);
break;
case '-'://if its -
printf("%.1lf - %.1lf = %lf\n\n", first, second, first - second);
break;
case '*'://if its *
printf("%.1lf * %.1lf = %lf\n\n", first, second, first * second);
break;
case '/'://if its :
printf("%.1lf / %.1lf = %lf\n\n", first, second, first / second);
break;
default://if its not + - / *
printf("error!");
}
}
}​

Answers

Answer:

the answer can be found HERE:

https://stackoverflow.com/a/13473767

put a leading space in the scanf(" %c", &op)

Explanation:

#include <stdio.h>

#include <unistd.h>

#include <ctype.h>

main() {

double first, second;

char op;

while(1){

printf(" Calculator\n");

printf("\n 7 8 9 / \n 4 5 6 x \n 1 2 3 - \nEnter operator: ");

scanf(" %c", &op); //entering operators such as + - \ *

printf("Enter two operands:");

scanf("%lf %lf", &first, &second); //entering operands such as 1 2 5 8 12 414

switch (op) { // printing the math

case '+'://if its +

   printf("%.1lf + %.1lf = %lf\n\n", first, second, first + second);

   break;

case '-'://if its -

   printf("%.1lf - %.1lf = %lf\n\n", first, second, first - second);

   break;

case '*'://if its *

   printf("%.1lf * %.1lf = %lf\n\n", first, second, first * second);

   break;

case '/'://if its :

   printf("%.1lf / %.1lf = %lf\n\n", first, second, first / second);

   break;

default://if its not + - / *

   printf("error!");

}

}

}

Two ways of calculating average returns are ______ and ______. Multiple select question. the arithmetic average the progressive average the geometric average the common average

Answers

Answer:

"Geometric Average Return Example. Jennifer has invested $5,000 into a money market that earns 10% in year one, 6% in year two, and 2% in year three. If you were to calculate this using the arithmetic mean return, you would add the rates together and divide them by three, giving you an average of 6%."

Explanation:

data in ai uses what >

Answers

Answer:

Explanation:

artificial intelligence describes the ability of computers to act like humans

A team of computer science researchers develop a program for searching trees that can be run in parallel. When they use distributed computing techniques to run the program on six computers in parallel, they find a speedup of 3. In this case, what does a speedup of 3 indicate?

Answers

Answer:

The program completed in a third of the time with six computers versus one computer.

Explanation:

The speedup of a parallel solution is measured in the time it took to complete the task sequentially divided by the time it took to complete the task when done in parallel (or put succinctly, speedup = sequential/parallel).A speedup of 3 means that the program took three times as long on one computer, which is the same thing as saying it took a third of the time with all six computers working in parallel.

when would instant messaging be the least effective means of communication

Answers

Instant messaging would be least effective means of communication when you have a series of complex questions to ask your colleague.

What is the aim of instant messaging?

Instant messaging is often used as a means of sending textual messages, It is known to be a short one and also quick in nature. It can occur   between business colleagues and friends.

Its  disadvantages is that its is an Ineffective tool for mass communication and also has issues when used for system for archiving.

See options below

A. When you want your colleague to let you know if the hyperlink you sent her is working

B. When you want to tell someone "Happy Birthday!"

C. When you have a series of complex questions to ask your colleague

D. When you want to call an impromptu meeting between some of the people in your office

Learn more about instant messaging from

https://brainly.com/question/26271202

Answer:

When you have a series of complex questions to ask your colleague.

Explanation:

Asking these questions on instant messaging is the least professional way you can ask a colleague about series topics that involve your job, it would be more professional to ask this at work rather than on via message.

Mateo wants the words "it’s snowing!" to appear in the output box and typed print (it’s snowing). this didn’t work. what needs to be added to the code?

a.
quotation marks
b.
a backslash
c.
a period
d.
a functional code

Answers

the answer is b . i just got this question right .

Answer:

a Quotation marks

Explanation:

In python, to print something it needs to have parenthesees and quotation marks.
a. Quotation marks

On a Windows computer, which tab can be used in Task Manager to set the priority given to a specific application or service?

Answers

Answer:

details tab

Explanation:

A programmer ensures the user inputs valid data by setting algorithms boundaries data output

Answers

Answer:

boundries

Explanation:

i did the test so trust me its right

The proper type of data is required. Users must, for instance, enter a figure in the field labeled “Total purchase units.” There must be a limit on the data's range of values. For instance, customers can only select a legitimate loan type from a list of possibilities.

What is the input's valid data by setting algorithms?

An input validation approach is used to ensure that the data given by a user is accurate.

A software might ask for a score between 0 and 50, for instance, and employ an input validation technique to make sure that numbers below 0 and beyond 50 are rejected.

Any Value—This nullifies any previous data validation. Whole Number—Only whole numbers are permitted. You might stipulate, for instance, that the user must enter a value between 0 and 30. Decimal: The user must provide a decimal-valued number.

Therefore, boundaries programmer ensures the user inputs valid data by setting algorithms boundaries data output.

Learn more about algorithms here:

https://brainly.com/question/28283722

#SPJ5

In a ________ system configuration, separate information systems are designed and managed by each foreign unit.

Answers

Answer:

In a decentralized system configuration, separate information systems are designed and managed by each foreign unit.

Explanation:

hopes this help (:

Pedestrians have ______.
A. to get out of your way when you’re driving
B. no right to use the Highway Transportation System
C. a right to use the Highway Transport System
D. to be on the sidewalk or crosswalk at all times

Answers

Answer:

c

Explanation:

I think c is correct answer if I answer wrong

Pedestrians have  a right to use the Highway Transport System. Hence, option C is correct.

What is Highway Transport System?

A system of highways used for the movement of cars. Type of transit, means of transportation, or transportation system. A structure that houses the equipment necessary for transporting people or goods.

A transportation system can be defined as the combination of factors and how they interact to produce the need for travel within a given area and the delivery of transportation services to satisfy this need. This concept is inclusive and flexible enough to be applied in various contexts.

For instance, people are transported to airports and ship docks using buses and cars. Transportation systems are a part of the larger technological, social, and environmental systems in our world.

Thus, option C is correct.

For more details about Highway Transport System, click here:

https://brainly.com/question/1071443

#SPJ2

Other Questions
local tribes said you were crazy to paddle down what river in your new canoes The home health nurse is conducting a home safety assessment for an older adult client following a hospital aminsion for frequent falls. List three assessment findings that require intervetnion CAn I go to school if I keep coughing and my chest hurts but my doctor said I can go, I keep coughing and my chest hurts should I go Which city was once known as the paris of the middle east?. Looking at the figure, the overall (SiO4) molecule, which forms the common mineral quartz, has a tetrahedral shape. It is probably a:non-polar moleculepolar molecule Briefly explain the two ways Avogadro's number was calculated. Which result was not an important outcome of the presidency of Bill Clinton? Please help me answer this question please? Find x. Perimeter.What is the value of x?What is the perimeter of this triangle? Debe el gobierno controlar la calidad de la comida en las escuelas pblicas? Identify the safety precaution below that is not important for a fitness center. a. the staff is trained in first aid. b. the fitness equipment is well-maintained. c. popular music is played throughout the center. d. the temperature is maintained at normal levels. please select the best answer from the choices provided a b c d Mayrin has rectangular rug with an area of 36 square feet. The area is represented by the equation f(x)= x2 + 5x 36 and this rug is 5 feet longer than it is wide. What are the dimensions of the rug? Ill give Brainly but can somebody help me with this? Use interval notation to express the following: The set of all numbers less than or equal to 5. Select the correct answer from each drop-down menu.Which two points must Ajay keep in mind when writing content for his web page?Ajay is writing web page content for a county health departments website. He should make sure that the text on the web page . He must also be careful to use a tone for the content Which process is most likely driven by light energy? Sam wants to create a linear function and an exponential function, both of which have a y-interceptof (0,8) and pass through the point (9,512). Help Sam create his functions. I need help, please? I am just really confused about this. Who led the Rough Riders Cavalry during the Spanish American War? Andrew Jackson Franklin D. Roosevelt Theodore Roosevelt Thomas Jefferson A person suffering from bulimia will most likely have dental problems due to the __________. A. exposure to stomach acid from vomiting B. vitamin deficiency from the deprivation of food C. lack of healthy hygiene habits D. tendency to eat foods high in sugar