Question

Hi, I am stuck and am trying to create a loop for this question: Create a...

Hi, I am stuck and am trying to create a loop for this question: Create a program that outputs the state of water (liquid, solid or gas) based on the following temperatures (degrees C): -25, 120, -11, 55, 99, 155, 133, 11. Thank you!

Homework Answers

Answer #1

I am writing the pseudo code. You can write down the final code in whichever language you are using.

First declare an array of the given temperatures.

Let it be

t=[-25,120,-11,55,99,155,133,11]

then take a variable for indexing. let it be i.

initialize i

i=0 // for MATLAB take i=1

for (i=0;i<=7;i++)

{

if (t[i]<=0)

print("State of water is solid");

elseif(0<t[i]<=100)

  print("State of water is liquid");

else

  print("State of water is gas");

}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Hi I am trying some proofs and I am stuck on this one. It says to...
Hi I am trying some proofs and I am stuck on this one. It says to prove or give a counter example. For each real number p, there exist real numbers q and r such that qsin(r/5) =p.
Hi I am trying to write a proof but I am a little stuck. The proposition...
Hi I am trying to write a proof but I am a little stuck. The proposition is: If c is greater than or equal to 2 is a composite integer then there exists a positive integer b greater than or equal to 2 such that b|c and b is less than or equal to root. I thought of doing an existence proof but Im not sure what to do after that.
Good day, I am trying to create a PICO question research question. Can you please give...
Good day, I am trying to create a PICO question research question. Can you please give me some examples that i can use? I am interested in newborn babies. Maybe something with home births vs hospital birth or water birth vs traditional birth and an increase in death with babies? I am not sure. Please help. Tell me what you want to find out/ what is your purpose of the research question.
Good day, I am trying to create a PICO question research question. Can you please give...
Good day, I am trying to create a PICO question research question. Can you please give me some examples that i can use? I am interested in newborn babies. Maybe something with home births vs hospital birth and an increase in death with babies? I am not sure. Please help.
Hi, I am trying to determine the formula of the coordination complex Cr(NH3)Cl. The question states...
Hi, I am trying to determine the formula of the coordination complex Cr(NH3)Cl. The question states use the percentages obtained for Cl, Cr, and NH3 and determine the formula of the Cr-complex Legna synthesized. I found the percent of Cr^3+ 19.97% and NH3 39.14%. How can I find the percent of Cl and the formula for the Cr complex?
Hello, I am trying to create a Java program that reads a .txt file and outputs...
Hello, I am trying to create a Java program that reads a .txt file and outputs how many times the word "and" is used. I attempted modifying a code I had previously used for counting the total number of tokens, but now it is saying there is an input mismatch. Please help! My code is below: import java.util.*; import java.io.*; public class Hamlet2 { public static void main(String[] args) throws FileNotFoundException { File file = new File("hamlet.txt"); Scanner fileRead =...
Binary Search Tree with multiple structs? Hi, I am having an issue with trying to create...
Binary Search Tree with multiple structs? Hi, I am having an issue with trying to create a binary search tree while having multiple structs. The struct code provided is provided for us. #define CAT_NAME_LEN 25 #define APP_NAME_LEN 50 #define VERSION_LEN 10 #define UNIT_SIZE 3 struct app_info{ char category[CAT_NAME_LEN]; // name of category char app_name[APP_NAME_LEN]; // name of application char version[VERSION_LEN]; // version number float size; // size of application char units[UNIT_SIZE]; // GB or MB float price; // price in...
I am working through review problems and was stuck on this question, could you please guide...
I am working through review problems and was stuck on this question, could you please guide me on how to approach this type of problem? Thank you! You are investing your money in two hedge funds and want to split your cash among two funds, Fund A and Fund B. If you invest $x dollars in Fund A, its worth after one year is distributed as a Normal (µA = 1.05x, σA2 = .02x2 ). If instead you invest $x...
Hi, you able to assist I am trying to compare? Question 3 Try-Us-First Motors manufactures and...
Hi, you able to assist I am trying to compare? Question 3 Try-Us-First Motors manufactures and sells off-road vehicles. The September sales were $6,000,000. Monthly design costs are $112,000 and rework is running at $75,000 per month. Its painting department is fully automated and requires substantial inspection to keep the machines operating properly. An improperly painted vehicle is very expensive to correct, and inspection hours for the 8,000 vehicles painted in September totaled 2,000 hours by 14 employees, who earn...
Hi, I am trying to create an XML JTree viewer using the DOM parser instead of...
Hi, I am trying to create an XML JTree viewer using the DOM parser instead of the SAX parser, I am having trouble changing my code in order to utilize the DOM parser to extract the XML data into the tree structure. Would you be able to explain what changes should be made to the code in order to use the DOM parser instead of the SAX parser? // Java Packages //      import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import...