Homework questions: If we define String s = "hello", then what is the value of s.compareTo ("ralph")? A. zero B. negative c. positive D either true or false. * rest in comments. Homework help please asap
The statement System.out.println ("14" + 3 + 7); prints _________ _________ ______ .
The Blob class has an instance variable named hours. Where can the coding this.hours = 5 be used? A. within any static method in Blob B. within any nonstatic method in Blob C.outside of every method, as long as it is within the Blob class D. none of the above
Complete this coding to print every character in a String named s. for (int k = 0; k < ________________ ; k++) System.out.println (s.charAt (k));
Put a number in the blank so that this coding counts the number of tabs, blanks, newlines, form feeds, and other special characters in the first 10 characters of a String named s. for (int k = 0; k < 10 ; k++) if ((int) s.charAt (k) <= ________________ ) count++;
what are u asking ?
I'm asking for help on completing some homework questions. They are due in a couple of hours.
ok what grade are u in ?
12th.Programming is tough and on these homework questions, I spend 6 hours tryingto answer them.
ok well im only in * sorry wish i could help thanks though have a great day
``` System.out.println ("14" + 3 + 7); ``` plug it in - see what it prints.
Complete this method to credit a deposit to a BankAccount object. class BankAccount { private double balance; public void addDeposit (double amount) { _______________ ; } A. double balance += amount B. double balance -= amount C. balance -= amount D. balance += amount
@woodrow73 I got 1437.
Good.
can you help me with the other questions @woodrow73?
the compareTo method subtracts on String's ascii equivalents with anothers -- if you're unsure, plug it in and find out for that one.
Basic string manipulation: http://codingbat.com/doc/java-string-introduction.html For loops: http://www.java-made-easy.com/for-loop.html
I'm confised for If we define String s = "hello", then what is the value of s.compareTo ("ralph")?
s.compareTo("ralph"); the method will return an int - you can print out that int to get your answer. Ascii table: http://www.unix-manuals.com/refs/misc/ascii-table.html
woodrow73 plz help me
i will give medal
Note: if s.comparTo("bleh"); returns negative, then the String s is alphabetically before the other String literal.
SELECT ALL THAT APPLY: Which of the following phrases can be used within this doStuff method? class BankAccount { private double balance; static double dollar; public static void doStuff (double given) { double interest; ... } A. this.balance B. this.dollar C. this.given D. this.interest E. none of the above Complete this coding to compute the balance at the end of 10 years when you put $1000 in a savings account at the end of each year and earn 5% interest annually. Use only one arithmetic operator in your answer. int k = 1; double balance = 1000; while (k <= 10) { k = k + 1; balance = ________ _________ ________ + 1000; } System.out.println ("saving $1000 per year gives $" + balance + " after 10 years."); The Test class is given below. Assume that ann and sue are variables of this Test class, where y is a sta class Test { private int x = 5; private static int y = 5; public void think () { x++; y++; } public void print () { System.out.println (x * y); } } A. 36 B. 42 C. 49 D. none of the above This coding prints _______ _________ _________ numbers. for (int x = 500; x > 1; x /= 2) System.out.println (x); printed numbers (500 250 125 62 31 15 7 3 ) Complete this coding in such a way that it prints out all the values read in that are between 100 and 999 inclusive. Assume that read() is a method that obtains a number that the user enters. for (double x = read(); x != 0; x = read()) if (x <= _________ _________ _______ ) System.out.println (x); my thought please check (1000 && x >= 100) Complete this coding to compute the gross pay that a person receives when she gets time-and-ahalf for all hours over 40 worked in a week. if (hoursWorked <= 40) grossPay = hoursWorked * ratePerHour; else grossPay = 40 * ratePerHour + ________ _________ ________ * ratePerHour * 1.5; my answer used to be hoursWorked. The first number that this coding prints is _____ _________ ___________ . for (x = 1; x < 100; x *= 2); System.out.println (x); System.out.println (x); printed number = 128. Complete this statement to round a given positive double value to the nearest integer value. int rounded = _______ _________ _________ (given + 0.5); If x has the value 10 and so does y, then what is the value of (x ++) * (-- y)? A. 10 * 9 B. 10 * 10 C. 11 * 9 D. 11 * 10 * my personal answer was C. please tell me the correct answer if i'm wrong.
@Loser66
@andrewhaze
holly hell thats a lot &srry
i go with C
but thats me not 100% sure tho
@woodrow73
You can't just lay out a bunch of homework questions... well you can, but if there's something in particular you want help with, I'll give it a try.
Join our real-time social learning platform and learn together with your friends!