Answer:
import java.util.Scanner;
public class num2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int total = 0;
for(int i=0; i<5; i++){
System.out.println("Enter next Int: ");
total = total+in.nextInt();
}
System.out.println(total);
}
}
Explanation:
In the code above written in Java programming language, the for loop statement for(int i=0; i<5; i++) ensures that the loop goes from 0-4 a total of five times.
At each iteration it requests a user to enter an int. The number entered is stored in the variable total which is initially assigned 0.
When the loop finishes execution, total is printed out
Answer:
oneMore(oneMore(oneMore(oneMore(oneMore(0)))))
Explanation:
- As a function has been explained which when given an integer results as a next integer. oneMore(given-integer)= next integer
- As we are restricted to use 0 only and can't use operators like + - * /.
- We have to obtain a value 5
- So doing step-by-step:
(oneMore(0))=1
(oneMore(oneMore(0)))=2
(oneMore(oneMore(oneMore(0))))=3
(oneMore(oneMore(oneMore(oneMore(0)))))=4
oneMore(oneMore(oneMore(oneMore(oneMore(0)))))=5
I haven’t read it, but just by the title it was probably talking about an incredible machine that was new to people.
Answer: what? do you need any help, bc I can help with any question you have
Explanation: