Search:

Type: Posts; User: UniverseCloud

Search: Search took 0.10 seconds.

  1. Replies
    1
    Views
    669

    What to call this? 9.31

    Can someone tell me what is the purpose of the block in the middle of the main method ? what do you call such action ?





    public class test {
    private static int i = 0;
    private static...
  2. Replies
    2
    Views
    6,438

    Re: Financial tsunami- Exercise_8_17.

    i just found it x-x..

    problem was in the outer loop x-x(from i >= 0 to i < 5), i just realized that the program was actually just running the inner loop once and leaving the other array values as...
  3. Replies
    2
    Views
    6,438

    Financial tsunami- Exercise_8_17.

    (Financial tsunami) Banks lend money to each other. In tough economic times,
    if a bank goes bankrupt, it may not be able to pay back the loan. A bank’s
    total assets are its current balance plus its...
  4. Replies
    2
    Views
    710

    Re: A puzzle exercise.

    I could barely see it..

    I changed the outer loop to be (int i = 1; i <= 100; i++).

    works like a charm now.

    thanks!

    P.S i got to add, adding print statements helped a lot : i didn't know...
  5. Replies
    2
    Views
    710

    A puzzle exercise.

    So here's the question:

    (Game: locker puzzle) A school has 100 lockers and 100 students. All lockers are
    closed on the first day of school. As the students enter, the first student, denoted
    S1,...
  6. [SOLVED] Re: My answer comes out a +0.020 more than the answer in the book

    yah i did it manually and the same result from the program...

    everything seems to be in order.

    Honestly i just assumed so, when a publisher publishes his 10th book you'd automatically think its...
  7. [SOLVED] Re: My answer comes out a +0.020 more than the answer in the book

    Sorry for late reply.

    Book output:


    Feet

    65.574 // << +0.006
    81.967 // << +0.008
    ...
  8. [SOLVED] Re: My answer comes out a +0.020 more than the answer in the book

    Book answer:



    Feet Meters | Meters Feet
    1.0 0.305 | 20.0 65.574
    2.0 0.610 | 25.0 81.967
    ...
    9.0 2.745 | 60.0 196.721
    10.0 3.050 | 65.0 213.115
  9. [SOLVED] My answer comes out a +0.020 more than the answer in the book

    It's a very small difference but unsettling, i checked the code and both are practically the same (intro to java (10th))

    The question is to display the values next to each other as you can see in...
  10. I don't understand how to use methods

    im studying from a book called "intro to java programming(10th edition)" it seems easy and all until i try to make a method, i just end up keeping them all in the main method.

    Is there any good...
  11. [SOLVED] Re: Exercise 5.1 in (intro to javaprogramming 10th edition)

    I thought long and hard at the time, i kept going through the other questions but i couldn't continue and got frustrated to so i went to redo chapter 3/4/5 and back to the question and noticed that i...
  12. [SOLVED] Exercise 5.1 in (intro to javaprogramming 10th edition)

    /*
    (Count positive and negative numbers and compute the average of numbers) Write
    a program that reads an unspecified number of integers, determines how many
    positive and negative...
  13. [SOLVED] Re: What is wrong with this code ( an exercise )

    Well, i was using an online compiler to run this program and it seems that the compiler didnt accept scanner ?? so recently i got my laptop back and wrote the program on dr.java and it worked! It was...
  14. [SOLVED] Re: What is wrong with this code ( an exercise )

    Sorry for the late reply! Been on and off on this question (Dont know why the its still giving me an error, a new one)
    Like, i got the else if part right but when it comes to both together to be...
  15. [SOLVED] Re: What is wrong with this code ( an exercise )

    Here is there errors and the full code:

    2 errors found:
    File: C:\Users\omar-\Desktop\java learning\ChapterThree.java [line: 17]
    Error: The operator && is undefined for the argument type(s)...
  16. [SOLVED] What is wrong with this code ( an exercise )

    So the exercise tells me to get the values a, b and c from the user and then use the quadratic formula to get both roots.

    if both are above 0, display both roots
    if both are 0, display 1 root
    if...
  17. Replies
    1
    Views
    966

    Clarification

    I've been reading this book and it had this code.


    27 double totalPayment = monthlyPayment * numberOfYears * 12;
    28
    29 // Display results
    30 System.out.println("The monthly payment is $" +
    31...
  18. Replies
    0
    Views
    1,169

    I need to work on something!

    I am fairly new and know my way around java but i want some kind of work ( or assignment ) to test myself, do you guys know of any good site that does such things ?
  19. Replies
    5
    Views
    924

    Re: Help the newbie

    Sorry for the late reply!



    double d = Math.PI*(Math.sqrt(7));
    System.out.printf("%5.6f", d);

    P.S if i removed the multiplication sign and used "double d =...
  20. Replies
    5
    Views
    924

    Re: Help the newbie

    It just says Method call expected with this error

    Error:(10, 24) java: cannot find symbol
    symbol: method PI(double)
    location: class java.lang.Math


    PI to the power of 7 should give me...
  21. Replies
    5
    Views
    924

    Help the newbie

    package com.company;

    public class Main {

    public static void main(String[] args) {

    double a = (1/84);
    double b = Math.sqrt(123456879);
    double c = Math.cbrt(2);
    ...
  22. Replies
    1
    Views
    814

    how do i add the calendar thing ?

    ==============================================================
    QUESTION:

    (Find the number of days in a month) Write a program that prompts the user to enter the month and year and displays the...
  23. Encoding Opcodes ( Exercise question )

    Am doing the exercises in the first chapter of the book " JAVA PROGRAMMING - From the ground up"

    In the short exercises, 7th exercise, the question is "If there are typically 120 different opcodes...
Results 1 to 23 of 23