HW01 Solution

HW01 Solution - Solution to Homework 1 public class HW01...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// Solution to Homework 1 public class HW01 { public static void main(String args[]) { // ********************************************************************************** ******** // Problem #1: ENGR 131 grade // ********************************************************************************** ******** double grade, exam1, exam2, hw1, hw2, inLab1, inLab2, quiz1, quiz2, inLecture1, inLecture2; exam1 = 90.0; exam2 = 100.0; hw1 = 100.0; hw2 = 95.0; inLab1 = 10.0; inLab2 = 9.0; quiz1 = 10.0; quiz2 = 8.0; inLecture1 = 10.0; inLecture2 = 0.0; grade = 0.5 * (exam1 + exam2) / 100.0 / 2 + 0.25 * (hw1 + hw2) / 100.0 / 2 + 0.15 * (inLab1 + inLab2) / 10.0 / 2 + 0.05 * (quiz1 + quiz2) / 10.0 / 2 + 0.05 * (inLecture1 + inLecture2) / 10.0 / 2; System.out.println("Grade Percentage = " + grade); System.out.println(); // Included to separate the output (not required) // ********************************************************************************** ******** // Problem #2: Square root //
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/10/2008 for the course ENGR 131 taught by Professor Xiaowei during the Spring '07 term at Case Western.

Page1 / 2

HW01 Solution - Solution to Homework 1 public class HW01...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online