Program that will calculate the heat transfer of a substance

Assignment Help C/C++ Programming
Reference no: EM13168169

write a program that will calculate the heat transfer of a substance (water) given three different shapes. The user has to be able to input the type of shape, so that the computer can calculate area, and plug it back in to the equation for heat transfer. The equation for heat transfer is given as:

 

q = (h)*(A)*(Ts-Ta)

 

q= heat transfer

A = area of the user inputted shape

Ts= surface tempurature

Ta= ambient tempurature

h= convective heat transfer coeeficient (given as 8.7 W/(C*m^2)

 

The three different shapes that have to be calculated for area (user choice) are:

 

1-A rectangular area

2-An elliptical area

3- Other area

 

The equation for an elliptical area is given as pi*(little radius)*(big radius)

For 'other' area, the user just imputs the area.

 

Here is my program so far. Could you please tell me what I'm doing wrong? I'm getting a ton of error messages.

 

/* The contained program is designed to calculate the heat transfer per unit area of a substance

*/

#include <iostream>

#include <cmath>

using namespace std;

 

int main()

{

    int shape(0);

    double  s1, s2, q, h(8.7), Ts, Ta, rl, rs, A, PI;

    PI = acos(-1);

    h = 8.7;

    cout<<"\nenter your surface Tempurature:";

    cin>>Ts;

    cout<<"\nenter the ambient (surrounding) Tempurature:";

    cin>>Ta;

    cin>>shape;

    switch(shape)

    {

 

    case 1://execute before the next major break statment is Shape = 1

        cout<<"\nenter the length of side 1:";

        cin>>s1;

        cout<<"\nenter the length of side 2:";

        cin>>s2;

        cout<<"\nyour area in case 1 is:";

        A = s1*s2;

        cout<<A<<endl;

        break;//go to the end of switch block

 

    case 2://execute the code before the next break statement if Shape = 2

        cout<<"\nenter the radius of the minor axis:";

        cin>>rs;

        cout<<"\nenter the radius of the major axis:";

        cin>>rl;

        A = (PI*rl*rs)>>endl;

        cout<<A<<endl;

        break;//go to the end of switch block

 

    case 3://execute beofore the next major break if statement is Shape = 3

        cout<<"\nenter your Area:";

        cin>>A;

        break;//go to the end of switch block

    }//end of switch

 

    cout<<"\ndetermine your surface area:";

    q = h*A*(Ts-Ta);

    cout<<"\nThe heat transfer of the substance is:"<<q<<endl;

 

 

 

    return 0;

}

 

 

Reference no: EM13168169

Questions Cloud

Write a computer program using q basic : write a computer program using q basic with the following information. We just started learning about loop commands but I'm completely lost. My teacher introduced the for next, do while, and do until loop commands and he suggested to use the for next..
The chief financial officer : The chief financial officer (CFO) of NCWR keeps a huge number of reports, spreadsheets, and other critical financial information on his computer, which runs Windows 7
Long-distance communication in a wan infrastructure : How can cables like UTP and coaxial cable be used for long-distance communication in a WAN infrastructure? Where are these cables used most often?
Catch clauses are listed is important : write a program that can be used to demonstrate that the order in which catch clauses are listed is important
Program that will calculate the heat transfer of a substance : write a program that will calculate the heat transfer of a substance (water) given three different shapes. The user has to be able to input the type of shape, so that the computer can calculate area, and plug it back in to the equation for heat trans..
Using your musicalinstrument class : Finally, create a Java test class that simulates using your MusicalInstrument class.  In your test class you should at a minimum: a) Construct 4 instances of your instrument, b) tune your instruments, c) print the name of your instrument d) print ..
Dubbing was coined as a term of copying : Dubbing was coined as a term of copying media in the 1980's for all mediums. What term was a major issue during the process of continously dubbing media? Digitization cured this issue.
Write a java program that uses the elapsed time : Write a Java program that uses the elapsed time for an event in second and then outputs the elapsed time in hours, minutes and seconds. (For example, if the desired time is 9630 seconds, then the output is 2: 40: 30)
Matching program that takes input from a text file : need to make a string matching program that takes input from a text file and outputs that match (if there is one) asked from the user. i have done this part , the only problem is that , with the output match , i also need to print some words before a..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Make a game in which you guess a number

Make a game in which you guess a number between two set numbers to find the answer, the game should tell you if you are too low in your guess or too high. For example

  Write a c program that asks for and reads in two integers

Write a C program that asks for and reads in two integers and then reports if one is a multiple of the other.

  Containing all the genes in the dna sequence

As described above plus an integer reference parameter, and return a dynamically-allocated array of strings containing all the genes in the DNA sequence. Each string in the array will contain a unique

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Write a recursive function that takes a string as parameter

Write a recursive function that takes a string as a parameter and prints its reversal in the same function in c++

  The fibonacci sequence

In the novel "The DaVinci Code", a scrambled version 13, 3, 2, 21, 1, 1, 8, 5 of the first eight Fibonacci numbers appear as one of the clues left by murdered museum curator Jacques Sauniere. In this assignment, we will do something related to t..

  Afunction that raises an integer to a positive integer

Write a function that raises an integer to a positive integer power. Call the function x_to_the_n, taking two integer arguments x and n.

  Find the sixth maclaurin polynomial for sin x

Find the sixth Maclaurin polynomial for sin x and use Chebyshev economization to obtain a lesser-degree polynomial approximation.

  Implement the readlog function

Implement the readLog function below, which is to (1) read the file, (2) populate a vector for each column, and (3) return the number of lines found.

  Program that compares the number of possible sequences

Write a c++ program that compares the number of possible sequences of the length L that can be generated. The program must output a formatted list comparing the number of possible sequences for L=5,6,7,8,9. given size N=9

  Program to enter number of values to be processed

Write c++ statements to permit the user to enter n, the number of values to be processed; then assign the anonymous array of n double values, storing its address in doublPtr.

  Design class for textbook-data field for grade level of book

Design a class named TextBook that is child class of Book. Include new data field for grade level of book. Create a displayTextBookInfo () method so that you can accommodate new grade-level field.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd