Build python

Prompt the user for the length,width and height of a room.


Calculate the area of the floor. (length*width)


Calculate the volume of the room. (length*width*height)


Display the area and volume to the user.


Open a file named “roomdata.txt”.


Write the area and volume to the file.

Answers

Answer 1

Answer:

You'd have to create a "roomdata.txt" file before writing to it.

Explanation:

#Python Geometry

lenght = int(input("Enter lenght: "))

width = int(input("Enter width: "))

height = int(input("Enter height: "))

def floor_area(area);

area = 0

area = lenght * width

return area

def room_volume(vol);

vol = 0

vol = lenght * width * height

return vol

print ("Area of floor = ", floor_area, "/n Volume of room = ", room_volume)

f = open ("roomdata.text", "w")

f.write("Area of floor = ", floor_area, "/n Volume of room = ", room_volume)

f.close()


Related Questions

I have been stuck on this lab this is my program.

Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print(f'Amount: ${dollars:.2f}')

My program:
quarters = int(input("Quarters: "))

dimes = int(input("Dimes: "))

nickels= int(input("Nickels: "))

pennies= int(input("Pennies: "))

dollars = (quarters * 0.25 + dimes * 0.10 + nickels * 0.05 + pennies * 0.01)

print("Amount: ${:.2f}".format(dollars))


not sure why my answer is for wrong.

my output is: (with input)
1

2

3

4

Quarters: Dimes: Nickels: Pennies: Amount: $1.41

expected out put is : Amount: $1.41

What about my code adds the extra part to my answer?

Answers

They are using the knowledge of computational language in python to write the values ​​of the coins and the total we find that

Writing code in python      

quarters = int(input())

dimes = int(input())

nickels = int(input())

pennies = int(input())

cents = (quarters*25 + dimes*10 + nickels*5 + pennies)

#convert cents to dollars

# 1 dollar = 100 cents

# n cents = n/100 dollars

dollars = cents / 100.00

#Print the amount in dollars upto two decimal places

print("Amount: $"+"{:.2f}".format(dollars))

See more about python at brainly.com/question/18502436

#SPJ1

Give an implementation of the abstract data type of a priority queue of integers as an
ordered list using the SML syntax (ML functor). Given the following:

type Item
val > : Item * Item -> bool

Answers

We can use the code for IntPQ to implement the priority queue construction:

functor PQUEUE(type Item  

              val > : Item * Item -> bool  

             ):QueueSig =  

struct  

   type Item = Item  

   exception Deq  

   fun insert e [ ] = [e]:Item list  

     | insert e (h :: t) =  

       if e > h then e :: h :: t  

                else h :: insert e t  

   abstype Queue = Q of Item list  

   with  

       val empty          = Q []  

       fun isEmpty (Q []) = true  

         | isEmpty _      = false  

       fun enq(Q q, e)    = Q(insert e q)  

       fun deq(Q(h :: t)) = (Q t, h)  

         | deq _          = raise Deq  

   end  

end;

What is SML?

The capital asset pricing model (CAPM), which displays varying levels of systematic, or market risk, of various marketable securities plotted against the projected return of the entire market at any one time, is represented graphically by the security market line (SML), a line drawn on a chart.

The supplied predicate, which we consider to be a total ordering, can be used as the priority order in a priority queue. The end result is a structure with a new type for the queue and a number of operations that work with it. We create a new structure from a group of types and values (a structure), and we represent this creation as an ML functor. A functor takes a structure and produces a new structure, much as how a function takes a value and makes a new value. To accomplish the formation of the priority queue, we can utilize the IntPQ code.

Learn more about SML here https://brainly.com/question/15901527

#SPJ10

in tabular form differentiate the first four generations of computer ​

Answers

Answer:

Explanation:

See attachment.

What are three benefits of sharing on social media?

Answers

Answer:

reach more organization

get viral to whole entire nation

it also enhance to people's knowledge and quatable understandment

What is the difference between a status bar, title bar, and tabs?

Answers

Answer:

Status Bar: a horizontal window at the bottom of a parent window in which an application can display various kinds of status information. The status bar can be divided into parts to display more than one type of information. The following screen shot shows the status bar in the Microsoft Windows Paint application.

Title Bar: horizontal bar at the top of a window, bearing the name of the program and typically the name of the currently active document.

Tabs: a tab is a clickable area at the top of a window that shows another page or area

what two QuickBooks Online payroll subscription levels include QuickBooks time

Answers

The two QuickBooks Online payroll subscription levels include QuickBooks time are:

Online Payroll Premium Elite subscription

What is this about?

QuickBooks Time mobile access is known to be commonly made up of one's QuickBooks Online Payroll Premium and also one's QuickBooks  Elite subscription that is said to be given at no additional cost.

Therefore, The two QuickBooks Online payroll subscription levels include QuickBooks time are:

Online Payroll Premium Elite subscription

Learn more about QuickBooks from

https://brainly.com/question/24441347

#SPJ1

Discuss the relationship amongst the following basic file elements: • Field. • Record. • File. • Database. • Directory.​

Answers

Answer:

describe two events from the life of the prophet that illustrate the way he treated non muslims3+15-75+375.

Explanation:

53+15-75+3756,1803+15-75+375describe two events from the life of the prophet that illustrate the way he treated non muslims

The commented line states that I have assigned a 2D array to a pointer but I want array of such pointers which could store numbers of 2D Array.

Answers

It is impossible to store numbers or contents of 2D array to a pointer array.

How to store pointers in 2D Arrays?

Arrays and pointers are different data structure elements, and there is a limit to the operations that can be performed on both.

Having said that, it is impossible to store numbers or contents of 2D array to a pointer array.

The closest you can do, is to use the following declaration:

int *p[] = {(array-type [][number of columns]) {Array-content}}

Read more about arrays and pointers at:

https://brainly.com/question/17355709

#SPJ1

Answer:

Get the element => *( (int *)aiData + offset ); calculate offset => offset = (1 * coloumb_number)+ 2); Add offset in array base address => (int *)aiData + offset; //here typecast with int pointer because aiData is an array of integer Get the element => *( (int *)aiData + offset );

If x=5 and y=3 will this condition execute? if(x > y)
A. yes
B. no

Answers

Yes
Because the x bigger than the y
A. yes

because 5 > 3 is a true value, therefore if(True) will execute

Which loop structure always uses a semicolon after the test condition?
A. for
B. do-while
C. while

Answers

Answer:

I would have to go with A

Explanation:

It could be B, but I'm going with A because of the fact that right after the condition, there is a semicolon, whereas for the do-while loop, the semicolon comes after the )

Syntax:

// For loop

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

{

// Body

}

// Do-while

int i = 0;

do

{

i++;

// Other code

} while(i < 9); // We do i < 9, because by the time we get to the condition, i = 10, because the increment happens before the condition is checked

Answer:

do-while

Explanation:

syntax:

do {

//the statements;

} while(the condition is true);

In the other two types of loops, you can put a semicolon after the condition, but it signifies the end of the statement (e.g.  for loop, it will mean end of for statement and it's body will have no meaning)

Which of the following is an antivirus software?
McAfee
Mozilla Firefox
Windows Firewall
Y2K

Answers

Answer:

McAfee

Explanation:

An antivirus is a standalone software that protects other software. On the other hand, a Firewall is capable of preserving both software and hardware on the network.

The antivirus software is McAfee. The correct option is A.

What is antivirus software?

An antivirus program detects and removes viruses and other types of malicious software from your computer or laptop.

Malicious software, also known as malware, is code that can harm your computers and laptops, as well as the data they contain.

Antivirus software is needed even though if persons are using a Mac or a Windows device, both of which encompasses some level of virus protection.

Install third-party antivirus software for total protection, including endpoint protection and response, as well as protection against malware and potentially unwanted programs.

Antivirus software scans your files and incoming email for viruses and deletes any that are found. McAfee, Norton, and Kapersky are examples of anti-virus software.

Thus, the correct option is A.

For more details regarding antivirus software, visit:

https://brainly.com/question/23845318

#SPJ2

state four input device that are used for playing gaming programs​

Answers

Answer:

Mouse, Keyboard, Headphones, Charger.

Explanation:

These can be plugged into the computer for gaming and other uses.

Answer:

mouse

joystick

keyboard

headset

Explanation:

A few more examples : a gaming keypad and a microphone

The Electronics Communications Privacy Act allows the government to have access to....?

Answers

The Electronic Communications Privacy Act allows the government to have access to a treasure trove of information regarding who you are, where you go, and what you do.

What is Electronic Communications Privacy Act?

Electronic Communications Privacy Act may be defined as a law that determines it is unlawful to wipe or apprehend communication, over wires.

This access to government is accumulated by cell phone providers, search engine operators, social networking sites, and other websites each and every day.

All such network providers track all major activities of individuals through the mode of electronic gadgets.

Therefore, it is well described above.

To learn more about The Electronics Communications Privacy Act, refer to the link:

https://brainly.com/question/14142485

#SPJ1

How might the design be changed so that additional copies of print statements would not be needed?

Answers

A design be altered so that additional copies of print statements would not be needed by changing the format spring.

What is the aim of a print statement?

The PRINT statement is known to be often sent data so that it is taken to the display terminal or to another kind of print unit.

Note that A design be altered so that additional copies of print statements would not be needed by changing the format spring.

Learn more about design from

https://brainly.com/question/1020696

#SPJ1

When an AC voltage is being measured
across a 15-ohm resistor which is carrying
a current of 12 amps,
the selector switch should be set to the AC voltage position of __volts.
A. 1000 B.2 C. 20 D. 200

Answers

Answer:

D.

200

Explanation:

Predicate Logic The following is a snippet of pseudocode designed to produce an array (similar to a matrix). The variables m and n are integer variables and the variable A is a two-dimensional array with 10 rows (indexed from 1 to 10) and 8 columns (indexed from 1 to 8). \array.pas\ For m:=1to * 10do For n:=1to * 8do forall m bullet forall n bullet A[m, n]in mathbb Z . (d) The entries in each row of the array A are sorted into strictly decreasing order. You will also be asked to decide whether each statement is True or False. For example, the above statement is True. As an example, the statement "All entries in the array A are integers." can be expressed as (e) Some of the entries of the array A are greater than 30. (b) All entries in the array A are positive and less than 70. 1. Express each of the statements below in predicate logic. (a) All entries in the array A are positive. In the code above, A[m.n] refers to the entry in row m and column n Your task is to express the various statements bel

Answers

The answer is A are greater

What is used for risk response control?

Answers

Answer:

Risk response control uses methods such as mitigate, avoidance, shift, actively accept, and passively accept.

Explanation:

Risk Response Control refers to the procedure of evaluating residual risks, detecting new risks, guaranteeing the execution of risk plans, and assessing the success of the plans in decreasing risk is known as risk response control. Whereby the risk response control techniques include acceptance, avoidance, transfer, and mitigation

Why do we need to connect computers"​

Answers

Answer:

batteries cant last connected to nothing forever probably

The Electronics Communications Privacy Act allows the government to have access to....?

Answers

Personal information like who the person is, what they do, and where they go are the information that can be accessed by the government under the Electronics Communications Privacy Act.

What is Electronics Communications Privacy Act?

Electronic Communications Privacy Act allows the government to have the authority to the suspicious activity that takes place at social sites or through the use of electronic devices.

The unlawful acts and issues are overseen so that any violent circumstances do not arise. The data is provided through networking sites, cell phone providers, etc.,

The suspicious and unlawful activities are tracked through the electronic device that allows the government to keep track of the activities that can be a threat to them and the country.

Therefore, the act allows the government to track personal information which is unlawful and unauthorized.

Learn more about Electronics Communications Privacy Act here:

https://brainly.com/question/3773028

#SPJ1

Why do you guys the internet who are planning to be Information technology technician?

Answers

Answer:

The biggest advantage of choosing information technology for a career is that it has a very low cost of education as compared to many other career choices. You don't need a 4-year degree to become an I.T. professional. Instead, you can get quick training to be certified in specific areas of Information Technology.

Consider the following code segment. How many unique new (do not count the starting process) processes are created? (you may want to supply some reasoning/diagram )
pid = fork();
if (pid >= 0) // pid greater than or equal to zero
fork();
fork()

Answers

The number of unique processes that are created is in the original process, you get the PID of the child process. In the child process, you get 0.

What is a Code Segment?

This refers to the portion of an object file that is in the virtual space of a computer that contains executable instructions.

Hence, we can note that since PID >= 0, then there would be the creation of two identical processes in which the original process returns the PID of the child process, and the output in the child process would be zero.

If we make use of a canonical tag,

p = fork();\\if (0 == p)

{

   // We're the child process

}

else if (p > 0)

{

   // We're the parent process

}

else

{

   // We're the parent process, but the child couldn't be created

}

Read more about code segments here:

https://brainly.com/question/25781514

#SPJ1

which is an example of analog d


evice​

Answers

Answer:

crt (cathode ray tube) vcr (video cassette recorder)

Explanation:

Which of the following best describes a hotspot as
used in the Action feature of PowerPoint?

an image containing visible hyperlinks
O an invisible hyperlink embedded in a slide
O
a feature that converts presentations to
documents
a feature that allows you to present a slide to
people located remotely

Answers

A statement which best describes a hotspot as used in the Action feature of PowerPoint is: B. an invisible hyperlink embedded in a slide.

What is a hotspot?

A hotspot can be defined as a visual effect that can be applied in Microsoft PowerPoint to content on a slide, so as to make elements (objects) interactive with the end users.

This ultimately implies that, an invisible hyperlink embedded in a slide is a statement which best describes a hotspot as used in the Action feature of PowerPoint.

Read more on PowerPoint here: https://brainly.com/question/26404012

#SPJ1

Answer:

It's B

Explanation:

i got it right on edg 2023

Write down the importance of cooling system on your machine to cools the workpiece and avoid damage during surface grinding process:​

Answers

The importance of cooling system on the machine is to avoid the buildup of the heat on the system due to working of system because heating of the system cause friction and spars, that damage the system.

What is a cooling system?

A cooling system help in cooling the machine, because when machine runs they produce heat and friction. Cooling system reduce the excess heat of the machines.

Thus, the  importance of cooling system on the machine is to avoid the buildup of the heat on the system due to working of system because heating of the system cause friction and spars, that damage the system.

Learn more about cooling system

https://brainly.com/question/13258295

#SPJ1

compare the results of both the RATS and Skipfish reports.

Answers

Answer:

The results of both reports RATS is known nas mouse and skipfish is known as one type of fish

The TCP\IP protocol was invented by who

Answers

Answer:

The TCP protocol was invented by Bob Kahn, Ray Tomlinson and Vint Cerf.

Explanation:

Answer:

Vint Cerf ,Bob Kahn and Ray Tomlinson

What is software engineering? What are the objectives of software engineering?

Answers

Answer:

The basic objective of software engineering is to develop methods and procedures for software development that can scale up for large systems and that can be used consistently to produce high-quality software at low cost and with a small cycle of time.

Explanation:

43
What are several examples of fictional photography?
O A
celebrity, fashion, glamour
OB.
nature, sports, life
OC. military, propaganda, commercial
OD. corporate, scientific, police
Reset
Next

Answers

Answer:

c

Explanation:

I think A for sure it shows everything I could think of in fictional photography

which of the following is not an internet service?
(a) E-supermarket
(b) Blogging
(c) E-commerce
(d) E-mail​

Answers

Answer:

Blogging is not an internet service.

Hope it helps!

The term ____ photography syndrome is often used to refer to photographers who who use zoom lenses all the time rather than prime lenses.

Answers

Answer:

The term Gear Acquisition photography syndrome is often used to refer to photographers who who use zoom lenses all the time rather than prime lenses.

Explanation:

Other Questions
Ms. Odonnell learned about a new ma-pd plan that her neighbor suggested and that you represent. She plans to switch from her old ma hmo plan to the new ma-pd plan during the annual election period. However, she wants to make sure she does not end up paying premiums for two plans. What can you tell her?. Dan sold 40 concert tickets in 5 days.Each day he sold 3 tickets MORE than theprevious day. The number of tickets hesold on the third day is? Rpondez la question suivant ( vos avis), dans 2-3 phrases:"Pourquoi est-il important de maintenir une bonne sant mentale?" pls help B (20,25) (12,9)C (150,125) (96,64)D ( 25, 150) (16,96) (9,54) E (5,125) (4,64) Read the Did United Sacrifice a Customers Well-Being to Its Own Needs example on p. 82 in Ch. 3 of Management: A Practical Introduction. In your response:Discuss whether you feel that this is how businesses view their customers.Examine whether an airlines need to staff or cancel a flight is more important than passengers needs to travel to their destinations.Explain what may happen if an airline makes a poor choice, as in Dr. Daos case, that affects its external stakeholders by jeopardizing its stock price. Which statement illustrates the difference between a chemical reaction and a nuclear reaction?A nuclear reaction releases more energy per gram and appears to violate the law of conservation of mass.A nuclear reaction releases less energy per gram and appears to violate the law of conservation of mass.A nuclear reaction releases more energy per gram but does not appear to violate the law of conservation of mass.A nuclear reaction releases less energy per gram but does not appear to violate the law of conservation of mass. a 42 year old woman presents with a painful, 3cm paraovarian cyst located in her broad ligament. ultrasonography reveals the cyst to be adjacent to the utetine tube, and laparoscopic surgery is scheduled. during surgery a small incision is made in the anterior abdominal wall and the scope is inserted into hee peritoneal cavity. what part of the broad ligament would most likely be incised to reach the tumor? provide an explanation Step 3: Now multiply the values to get 14,918,904,000. That is almost15 billion passwords.That is a lot of passwords! How many passwords would the websitehave if users were allowed to reuse the letters and numbers? (Enterthe number of successful outcomes in each of the blanks below.2 The number 900 is increased by 20% and then decreased by 20%. Find the new number.(the ans is 864 apparently:/ I need steps) Expand:4(5x+5) - 3(2x + 4) When values, attitudes, and ways of doing things result from belonging to a specific ethnic, racial, or other group that one identifies closely with, it is termed a(n): When what is visible to end-users is a deviation from the specific or expected behavior, this is called: Read the excerpt from "Choice: A Tribute to Dr. Martin Luther King, Jr. by Alice Walker.At the moment I first saw him, he was being handcuffed and shoved into a police truck. He had dared to claim his rights as a native son, and had been arrested. He displayed no fear, but seemed calm and serene, unaware of his own extraordinary courage. His whole body, like his conscience, was at peace.What is the effect of the pathos in this excerpt?It questions Kings ability to be a leader. It provides historical context about King. It highlights Kings impact on the speaker.It suggests that King did not want to appear conceited. The stock of Company A gained 6% today to $87.45. What was the opening price of the stock in the beginning of the day? Why did economic specialization become common in civilizations?A. Stone tools could only be wielded by men. B. Women were not allowed to gather food. C. Most people were not physically able to hunt.D. There was more to do than look for food. How and why do economic actors analyze opportunity costs to determine which goods or services they should specialize in? Really need help on this asap pleasee!giving out 15 points out for this :) Patsy has a Mary Kay cosmetic business. She uses word-of-mouth selling techniques to promote her products and encourages her customers to have at-home parties so that she can demonstrate her products and take orders. The only problem is that Patsy doesn't speak Spanish and she lives in a predominantly Spanish speaking community. This example shows that _______. a. Patsy has too small of a market to be successful b. Patsy's business meets the criterion of accessiblity c. Patsy must be able to reach and speak to members of targeted segments d. Patsy's business meets all criteria for a useful segmentation scheme Questions 1. Why does the colour change not occur instantly? Questions 1 . Why does the colour change not occur instantly ?in the reaction between carbon dioxide and water Suppose that you have the following definitions:struct time Typestruct tourType{int hr;double min;int sec;string cityName;int distance;timeType travelTime;};};a. Declare a variable destination of type tourType.b. Write C++ statements to store the following data in destination: cityName - Chicago, distance -- 550miles, travelTime - 9 hours and 30 minutes.c. Write the definition of a function to output the data stored in a variable of type tourType.d. Write the definition of a value-returning function tat inputs data into a variable of type tourType.e. Write the definition of a void function with a reference parameter of type tourType to input data in avariable of type to tourType