JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
Intro to Java Day 10 Homework
Slides for reference:
https://docs.google.com/presentation/d/1TiyYNC7q6U79Ao66Y-l_cJhCyu-lUBci5xwXmxEu_Rk/edit?usp=drive_web&ouid=112300110132116883203
* Indicates required question
Email
*
Record my email address with my response
What are loops used for?
*
1 point
Repeating a certain section of code multiple times
Making decisions for what code to run
To allow the program to do multiple calculations at once
To make the program run faster
What is a correct declaration of a for loop (assume no variables are previously declared)?
*
1 point
for (int i = 0, i < 10, i++)
for (i = 0; i < 10; i++)
for (int i = 0; i < 10; i++)
for (i = 0; i++; i < 10)
All of the above
How many times will this for loop run?
for (int i = 0; i < 5; i++) {
//code
}
*
1 point
4
5
6
0, there is an error.
How many times will this code print out "t"?
for(int i =0; i<10; i++){
for(int j=0; j<10; j++) {
System.out.println(“t”);
}
}
*
1 point
20
10
100
1000
0, there is an error.
Free response: please attempt these, if you really tried and couldn't figure it out submit "I don't know" and we will cover it in class.
Find the output of this code segment WITHOUT running the code in your IDE: (one line)
Hint: Use paper to track variables.
*
1 point
Your answer
Write a code that finds the sum of all even numbers from 1 to n (not including n) where n is an imputed number
Hint: Use Scanner to input n, think about the change of variables for each even number
*
1 point
Your answer
A copy of your responses will be emailed to .
Submit
Page 1 of 1
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google.
Report Abuse
-
Terms of Service
-
Privacy Policy
Forms