Hey all, taking a programming logic and design course (OOP related) and I’m kind of stuck on a task from an assignment:
1) Write the pseudocode for an application that accepts a number as input and displays the number three times.
I imagine you would use a loop to do this, but we haven’t covered loops yet. Just methods, classes, and data. So is there a way I can do this without using a loop?
Heres an example, another task told me:
Write the pseudocode for an application that accepts two numbers and displays the sum of the two numbers.
class Test {
int count = 0;
void times(int n) {
if(count==3) return;
else count++;
System.out.println("Time is " + count + " " + n);
times(n);
}
}
class Threetime {
public static void main(String args[]) {
Test t = new Test();
t.times(10);
}
}