{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sample-mt-sol

sample-mt-sol - ECE-C490(Programming for Engineers...

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

View Full Document Right Arrow Icon
ECE-C490 (Programming for Engineers) Solutions to Sample Mid-Term Examination Winter 2005-06 Department of ECE, Drexel University (100 points, 1 hour and 20 minutes) Problem 1. (a) o o v = (b) What is k now: 5 or 7 (c) The answer is either 8 or 1 (d) That it is lunch time is false? true? (e) Thursday Monday Tuesday Wednesday Thursday Tuesday Thursday Tuesday Thursday Thursday (f) D E (g) The total is 14 1
Background image of page 1

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

View Full Document Right Arrow Icon
Problem 2. public class MaxTwo { public static void main ( String[] args ) { int a, b; Scanner input = new Scanner( System.in ); System.out.print( "Enter first integer: " ); a = input.nextInt(); System.out.print( "Enter second integer: " ); b = input.nextInt(); MaxTwo m = new MaxTwo(); if ( m.mystery( a, b ) ) System.out.println( "The maximum of the two is " + a ); else System.out.println( "The maximum of the two is " + b ); } public boolean mystery ( int x, int y ) { if ( x >= y ) return true; else return false; } } 2
Background image of page 2
Problem 3. import java.util.*;
Background image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

sample-mt-sol - ECE-C490(Programming for Engineers...

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

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