Reference:While: https://www.tutorialspoint.com/java/java_while_loop.htmDo While: https://www.tutorialspoint.com/java/java_do_while_loop.htm
@danny481 and @ trjoshi3011 answers are correct. Meanwhile refer below resources. It might help.
While loop.
Do-while loop.
R5.6
a. 0 10 b. 0 10 etc.
1 9
2 8
3 7
4 6
R5.19
https://repl.it/@Brainseater905/TransparentSeagreenBundledsoftware Warning: Do not press RUN. If you do, your computer is likely to crash.
R5.1
a. **********
b.====
*====
**====
***====
****====
c. stars
stripes
stars
stripes
stars
stripes
stars
stripes
stars
stripes
stars
stripes
(Crashes Computer)
R5.22
a.10
b.6
c and d. error
R6.2 a. 0 10 b. 10,12,14,16,18,20...
1 9
2 8
3 7
4 6
R.6.1 a.
*
**
***
****
b.
=====
*
====
**
===
***
==
****
=
c.
*****
*****
*****
*****
*****
...
R6.22
a. 10
b.1.925
c.error
d.error
r6.2
a. 0 10
1 9
2 8
3 7
4 6
r6.2 b.
010
19
28
37
46
r6.19
int n = in.nextInt();
double x=0;
double s=1.0;
while(s > 0.01)
{s=1.0/(1+n*n);
n++;
x=x+s;
}
r6.1
a.
*
**
***
****
b.
=====
*====
**===
***==
****=
c.
*****
=====
*****
=====
*****
=====
*****
=====
*****
=====
r6.22
a.10
b.0.27916666666
c. 2
d. 2
R6.2 a. 0 10 1 9 2 8 3 7 4 6 b. 01011121231341451561671781891910201121...
R6.19 https://repl.it/@DaveyYu/Homework-for-October-31-3-or-October-28 don't know if it works or n
R6.1
a.
*
**
***
****
b.
=====
*====
**===
***==
****=
c.
*****
R6.22
a. 10
b.6
c.error
d.error
R2a
0 10
1 9
2 8
3 7
4 6
R2b
10
12
14
16
18
20
22
24
26
28
30...
R1a
*
**
***
****
R1b
=====
*
====
**
===
***
==
****
=
R1c
*****
*****
*****
*****...
R22a 10
R22b 1.78333333...
R22c 2
R22d 0