Search:

Type: Posts; User: brobertson300

Page 1 of 2 1 2

Search: Search took 0.21 seconds.

  1. Re: Cant end input of data on my program...please help

    No, the directions said ctrl/press z then Enter key....
  2. Cant end input of data on my program...please help

    So here are my directions for this program:

    Write a program that allows the user to enter students names followed by their test scores and outputs the following information(assume that the maximum...
  3. Re: Help with logic to find the day number of the year

    What do you mean by high level?... I have not worked out the "details" do I make some sort of loop? maybe a for loop or should i use the switch method? and if i use a for loop how would I get a...
  4. Re: Help with logic to find the day number of the year

    Right I could use the Scanner class and use nextInt method 3 times and assign them to a variable. I will definitely do that. The program needs to read those numbers and keep a running total of the...
  5. Re: Help with logic to find the day number of the year

    Norm, I dont have anything as of yet... I think I need to assign the date to a number then keep a running count until December 31st. I am unsure of how to just single out the month and day from the...
  6. Help with logic to find the day number of the year

    Hello, I need help with figuring out the logic to print the day number of the year. The directions for my homework are: Write a program that prints the day number of the year, given the date is in...
  7. Replies
    9
    Views
    1,308

    Re: writing a method to add fractions?

    okay so....


    public static double m(double i)
    {
    double sum = 0;
    sum += (double) (i / (2*i + 1));
    total = sum + sum
    return total; //Will this return the accumulative...
  8. Replies
    9
    Views
    1,308

    Re: writing a method to add fractions?

    I understand it is a poor name for a method however thats what the teachers instruction are. Do I need to call the method into my println?

    --- Update ---



    import java.text.DecimalFormat;
    ...
  9. Replies
    9
    Views
    1,308

    Re: writing a method to add fractions?

    2829
  10. Replies
    9
    Views
    1,308

    Re: writing a method to add fractions?

    When I compile it shows the 'i' = 1,2,3,4....20 but the m(i) is 0,0,0,0.... and needs to be 0.3333, 0.7333.... all the way to 9.2480... its supposed to add all the fractions together and display......
  11. Replies
    9
    Views
    1,308

    writing a method to add fractions?

    Okay so I have to write a method to compute the following series: m(i)= 1/3 + 2/5 +....+ (i / 2i+1) and write a test program that displays a table " i = m(i)" 1=0.3333 2=0.7333....all the way down...
  12. Re: Please help with method return statement!

    Is my updated version OK? It seems to do what I need it to do...
  13. Re: Please help with method return statement!

    Okay I got it to compile and run. However, now it always returns not prime. I think its because i set boolean notPrime = true; but, if I dont set it to anything it says that notPrime needs to be...
  14. Re: Please help with method return statement!

    So I need to just add a guaranteed return statement and it will be fine? My coding is okay?

    --- Update ---

    I keep trying to add another return statement and cant seem to figure it out. Can you...
  15. Re: Please help with method return statement!

    Not sure I follow you, Norm. So there should only be one return statement?

    --- Update ---

    Should there not be a for loop in the method?
  16. Please help with method return statement!

    Im having trouble with my method return. I am new to using methods and cant seem to grasp the idea on the return part. I have to write a method that tells if a number is prime or not. This is what I...
  17. [SOLVED] Re: Cannot get right output? Missing something? please help!

    Okay I tried and I am still getting the same output. I think I am actually thinking about it all wrong. My code is right but i was thinking it should just divide the last number and get my result...
  18. [SOLVED] Cannot get right output? Missing something? please help!

    Okay for the life of me I cannot get the right output for my program. I need to get the total number of pennies in dollar amount for the output of Total Pay. This is my program. The directions are:
    ...
  19. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    2799
  20. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    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...
  21. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    import java.util.Scanner;

    public class twoIntegers
    {
    public static void main(String[] args)
    {

    Scanner keyboard = new Scanner(System.in);

    //Part A
  22. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    just use if and if else statments to tie it all together?
  23. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    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...
  24. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    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...
  25. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    int i = firstNum;
    int sum = 0;

    while(i <= secondNum)
    {
    if(i % 2 == 0)
    {
    System.out.println(i);
    sum += i;
    }
Results 1 to 25 of 48
Page 1 of 2 1 2