Problem Set 5 Solutions - Introduction-Computer Science | CS 110, Assignments of Computer Science

Material Type: Assignment; Professor: Tanner; Class: Introduction-Computer Science; Subject: Computer Science; University: West Virginia University; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-wg2
koofers-user-wg2 🇺🇸

7 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS110 Homework Set 5 Solution
P303 #14, #16, #18, #20
10 points total
#14 2 points
Answer: 0 10 30 60
#16 3 points
a.
iii 26
b.
iv. 5
c.
i 0
#18 3 points
public class Assignment5
{
public static void main (String[] args)
{ int num = 0;
for (int i = 0; i< 100; i ++)
{
if (i%3 == 0)
num += i;
}
System.out.println(num);
}
}
#20 2 points
Answer: 11 19 30 49

Partial preview of the text

Download Problem Set 5 Solutions - Introduction-Computer Science | CS 110 and more Assignments Computer Science in PDF only on Docsity!

CS110 Homework Set 5 Solution P303 #14, #16, #18, # 10 points total

#14 2 points Answer: 0 10 30 60

#16 3 points a. iii 26

b. iv. 5

c. i 0

#18 3 points

public class Assignment { public static void main (String[] args) { int num = 0; for (int i = 0; i< 100; i ++) { if (i%3 == 0) num += i; } System.out.println(num); } }

#20 2 points Answer: 11 19 30 49