Question

Which of the following statements converts a String object named subtotalString to a double variable named...

Which of the following statements converts a String object named subtotalString to a double variable named subtotal?

a.

double subtotal = Double.parseDouble(subtotalString);

b.

double subtotal = Double.toString(subtotalString);

c.

double subtotal = (double) subtotalString;

d.

double subtotal = subtotalString.parseDouble;

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Which of the following statements converts a String object named subtotalString to a double variable named...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Which of the following statements will convert a string s into a double value d? d...

    Which of the following statements will convert a string s into a double value d? d Double.parseDouble(s) d- (new Double(s)).doubleValueO d- Double.valueOfs) doubleValueo. d All f the above a. b. of the following statements convert a double value d into a string s? s (new Double(d)).toStringO. b. C. new Double(d).stringoro: String stringotd d. Which of the following statements is correct? b Integer d. Integer parselnt(100, 16); Integer parselnt"12",2) Integer parselntc 100"): Integer parselnt 345", 8) parselnt(100); e. What is the...

  • Which of the following statements uses a Scanner variable named sc to return the next value...

    Which of the following statements uses a Scanner variable named sc to return the next value the user enters at the consolse as a String object and store it in a variable named city? a. String city = sc.next(); b. String city = sc.nextString(); c. String city = sc.next().toString(); d. String city = sc.nextValue();

  • QUESTION 1 Given two double variables named x and y, which of the following statements could...

    QUESTION 1 Given two double variables named x and y, which of the following statements could you use to initialize both variables to a value of 0.0? a. x | y = 0.0; b. x = y = 0.0; c. x, y = 0.0; d. none of the above 1 points    QUESTION 2 When you use a range-based for loop with a vector, you a. can avoid out of bounds access b. must still use a counter variable c....

  • Given the availability of an ofstream object named output , and a string variable name tweet ,...

    Given the availability of an ofstream object named output , and a string variable name tweet , write the other statements necessary to open a file named mytweet" ,display the prompt tweet: and then read an entire line into tweet and then write it out to the file mytweet.

  • In C# (sharp) Assuming a string variable named movie Title has already been declared, which one...

    In C# (sharp) Assuming a string variable named movie Title has already been declared, which one of the following statements combines the strings "Hidden" and "Figures" and then assigns the resulting string to the variable? 1. movieTitle="Hidden" + "Figures"; 2. "Hidden" +"Figures" - moveTitle; 3. movie Title("Hidden" +"Figures"); 4. movie title="Hidden" & "Figures": Look at the following code: int distance; // Declare distance as an int double half://Declare half as a double distance = 35; // Assign 35 to distance...

  • 5. Which one of the following statements declares a c-string variable? a.char c; b. string s;...

    5. Which one of the following statements declares a c-string variable? a.char c; b. string s; c. char c[10]; d.string s[10]; 6. ________________ function returns the uppercase version of expression. a. tolower(expression); b. upper(expression) c. toupper(expression); d. isupper(expression); 7. Which of the following creates a string object with data ‘csci-1410’? a. string str; b. string ‘csci-1410’; c. string s("csci-1410"); d. string s(csci-1410);

  • Which of the following statements prints a variable named total to the console, followed by a...

    Which of the following statements prints a variable named total to the console, followed by a new line character? a. System.out.print(total); b. System.out.println(total); c. Console.out.println(total); d. Console.out.print(total);

  • The C statement: double &x; a) declares a variable named %x with type double b) declares...

    The C statement: double &x; a) declares a variable named %x with type double b) declares a variable named x that is located in the heap c) double (multiples by 2) the value that is pointed to by x d) causes a compilation error

  • Book: - title: String - price: double +Book() +Book(String, double) +getTitle(): String +setTitle(String): void +getPrice(): double...

    Book: - title: String - price: double +Book() +Book(String, double) +getTitle(): String +setTitle(String): void +getPrice(): double +setPrice(double): void +toString(): String The class has two attributes, title and price, and get/set methods for the two attributes. The first constructor doesn’t have a parameter. It assigns “” to title and 0.0 to price; The second constructor uses passed-in parameters to initialize the two attributes. The toString() method returns values for the two attributes. Notation: - means private, and + means public. 1....

  • 1) Which of the following is the name of a local variable in the Strange class...

    1) Which of the following is the name of a local variable in the Strange class below? public class Strange{ public static final int MAX = 5; public static void unknown(){ int number = 0; for (int i = MAX; i >= 1; i--) number += i * i; System.out.println(number); } public static void main(String[] a){ unknown(); } } a) Strange b) int c) MAX d) number e) main 2) Which of the following is NOT a method of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT