2799
Type: Posts; User: brobertson300
Yes I am familiar with \n however that is not what I was suggesting. I think because my output is in a loop it prints everything rather then just one statement and then the multiple outputs im...
import java.util.Scanner;
public class twoIntegers
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
//Part A
just use if and if else statments to tie it all together?
This is my whole program so far... steps A through E. The directions again are posted above. I am just piecing together what I know. The logic is there but the format definitely isnt.
import...
Can you show me a example? not with my assignment but something general? I am a visual learner. I am not asking for someone to do my assignment becasue i want to learn it but i also need something...
int i = firstNum;
int sum = 0;
while(i <= secondNum)
{
if(i % 2 == 0)
{
System.out.println(i);
sum += i;
}
Part C) I need to output the sum of all even numbers between firstNum and secondNum (10,20). How would I transition into that? I have only done simple one part programs.
Okay I got it to work and output all odd numbers between 10 and 20... onto the next part!
import java.util.Scanner;
public class whileLoop
{
public static void main(String[] args)
{
Yes I am familiar with Scanner. I prompted the user to input two integers but now i need to read from the keyboard the values they entered which should be 10 and 20. Above I posted the directions for...
Hello all! I have a assignment due tomorrow morning and I am totally clueless. I have tried reading a bunch of things on while loops but dont seem to understand it fully. This is my directions for...
Can you please just help me besides critizing my curly braces? I understand its important but I need help with the actual program. I will figure out the format of it later. I need help with the logic...
Okay I tried correcting it
Thanks for the tips!
Hello all! I have a assignment due tomorrow morning and I am totally clueless. I have tried reading a bunch of things on while loops but dont seem to understand it fully. This is my directions for...