Question 3a) Write an algorithm that calculates the volume of a house and the cost of heating the house. The house is assumed to have the shape of a box with a prism on top as roof. The dimensions of the house: Width, Length, Height, and RoofSide are given in meters. The cost of heating one cubic meter (1 m3) of the house is $0.34 (for a month).
Question 3b) Java Implementation of 3a). The dimensions of the house are input from the keyboard (you can assume the user inputs valid values, positive real numbers). The volume of the house and the cost of heating are displayed on the screen.
k the question shows a picture of a house ... a rectangular prism wit a triangular prism on top. All dimensions of the house are shown except the height of the triangle. So you have to calculate the height to find the volume and then find the cost. i know how to do part A but need help wit part B.
2006-10-09
08:34:03
·
2 answers
·
asked by
moooona1987
2
in
Computers & Internet
➔ Programming & Design
//program compute heat--this program calculates the volume of the house and from that compute// cost of heat.
import java.io.*
class ITI1120B
{
public static void main (string args[])
{
//DECLARE VARIABLE/DATA DICTIONARY
double roofside,height1,length,width,cost/m3 ; // given numbers
double volume ; // intermediate, height of roof , H2
double cost ; // result, volume, cost of heat/month
// PRINT OUT IDENTIFICATION INFORMATION
system.out.println() ;
system.out.println ( "ITI 1120 Fall 2006, Assignment 2, Question 3b");
system.out.println("Name: Muna Jaddou , Student# 3807312 and Mohamed Zaki ,Student#4154845")
System.out.println();
//READ IN GIVENS AND MODIFIEDS
// ITI1120.readDouble()
//BODY OF ALGORITHM
this is what i have so far
2006-10-09
08:47:52 ·
update #1