Question

1. To round and format the value of a variable named Snumber to 3 decimal places and store it in a variable named Snumber formatted, you code a. Snumber_ formatted - number format (Snumber, 3, round) b. Snumber formatted - number format (8number, 3) c. $number formatted format_number (Snumber, 3, round) : d. Snumber formatted format number (Snumber, 3): 2. After the if statement that follows is executed, what will the value of SdiscountAmount be? Sdiscount amount Sorder total 200 if (Sorder total 200) Sdiscount amount- Sorder_ total.3: Sdiscount amount Sorder_total .2: sdiscount amount - Sorder_ total.1 else if (Sorder_total > 100) t else a. 0 b. 20 c. 40 d. 60 3.If StotalMonths has a value of 13, what does Smessage contain after this if statement is executed? Syears -$total months /12: years -number format (Syears): $months-$total months % 12; if ( syears-0 message Smonthsmonths Smessage -$years years Smessage - Syears years, and months months alse if ($monthso ) else a. 1 yoars, and 1 months b. 1 year, and 1 month d. 1 year
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. b) $number_formatted = number_format($number, 3);
2. c) 40
3. a) 1 years, and 1 months

Add a comment
Know the answer?
Add Answer to:
1. To round and format the value of a variable named Snumber to 3 decimal places...
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
  • 2.908 Submit Answer format: Number: Round to: 3 decimal places. #13 How many milliliters should be...

    2.908 Submit Answer format: Number: Round to: 3 decimal places. #13 How many milliliters should be added for 0.5 molar equivalents of anisole? (1 decimal place, include number & units) Submit Answer format: Text #14 Points: 12/20 Grade: 60% Progress: 60% Type here to search 바

  • 3. (12) Write a function named getSumSquares. You can skip writing the function prototype. This function...

    3. (12) Write a function named getSumSquares. You can skip writing the function prototype. This function has two int arguments called first and last. The function is to add up the tube of each number from first to last and return the total. (Note: the easy way to get the square of a number a is with: a * a). Square To see how the function works, here is an example. After the statement int c = getSumSquares (2, 4);...

  • Question 1 (Marks: 35) Create a class named Customer that will determine the monthly repayment amount...

    Question 1 (Marks: 35) Create a class named Customer that will determine the monthly repayment amount due by a customer for a product bought on credit. The class has five fields: customer name, contact number, product price, number of months and the monthly repayment amount. Write get and set methods for each field, except for the monthly repayment amount field. The set methods must prompt the user to enter the values for the following fields: customer name, contact number, product...

  • Select the correct answer. (1)     Which of the following will open a file named MyFile.txt and...

    Select the correct answer. (1)     Which of the following will open a file named MyFile.txt and allow you to read data from it?                (a)      File file = new File("MyFile.txt");           (b)      FileWriter inputFile = new FileWriter();           (c)       File file = new File("MyFile.txt");                      FileReader inputFile = new FileReader(file);           (d)      FileWriter inputFile = new FileWriter("MyFile.txt"); (2)     How many times will the following do - while loop be executed?                      int x = 11;             do {             x...

  • ANSWER IN QALYS. DISCOUNT ALL THREE YEARS. ROUND TO TWO DECIMAL PLACES. 1. Suppose Sam has...

    ANSWER IN QALYS. DISCOUNT ALL THREE YEARS. ROUND TO TWO DECIMAL PLACES. 1. Suppose Sam has the opportunity for a treatment that will extend his life by one year with a probability of 0.78 by two years with a probability of 0.50, and three years with a probability of 0.18. Sam will die with certainty after three years. QALY weight q1 is 0.9 in year 1, q2 is 0.6 in year 2, and q3 is 0.2 in year 3. The...

  • Create a Java Program/Class named ComputeInterest to calculate compound interest. This can all be done entirely...

    Create a Java Program/Class named ComputeInterest to calculate compound interest. This can all be done entirely in the main() method. Create a double variable named currentBalance. Create a double variable named newBalance. Create a final double variable named INTEREST_RATE and assign 1.05 to it. Create a int variable named yearCount. Prompt for the "Number of years to invest" and store the input into the yearCount variable. Prompt for the "Amount to Invest" and store this in the currentBalance variable. Assign...

  • Presented below are four independent situations. (Round answers to 0 decimal places, e.g. 125. If answer...

    Presented below are four independent situations. (Round answers to 0 decimal places, e.g. 125. If answer is 0, please enter 0. Do not leave any fields blank.) (a) On December 31, 2017, Concord Inc. sold computer equipment to Daniell Co. and immediately leased it back for 10 years. The sales price of the equipment was $521,500, its carrying amount is $403,700, and its estimated remaining economic life is 12 years. Determine the amount of deferred revenue to be reported from...

  • Presented below are four independent situations. (Round answers to 0 decimal places, e.g. 125. If answer...

    Presented below are four independent situations. (Round answers to 0 decimal places, e.g. 125. If answer is 0, please enter 0. Do not leave any fields blank.) (a) On December 31, 2017, Sarasota Inc. sold computer equipment to Daniell Co. and immediately leased it back for 10 years. The sales price of the equipment was $517,100, its carrying amount is $398,400, and its estimated remaining economic life is 12 years. Determine the amount of deferred revenue to be reported from...

  • PLEASE ROUND TO THE DECIMAL PLACES GIVEN. The following regression output was obtained from a study...

    PLEASE ROUND TO THE DECIMAL PLACES GIVEN. The following regression output was obtained from a study of architectural firms. The dependent variable is the total amount of fees in millions of dollars. Predictor Constant X2 Coefficient 9.387 0.232 -1.214 -0.273 0.642 -0.060 SE Coefficient 3.069 0.204 0.584 0.424 0.362 0.028 p-value 0.010 0.000 0.028 0.114 0.001 0.112 3.059 1. 137 -2.079 -0.644 1.773 -2.143 x3 X4 Analysis of Variance Source DF SS Regression 5 2,364.50 Residual Error 53 2,436.07 Total...

  • public static void main(String[] args) {         System.out.println("Welcome to the Future Value Calculator\n");         Scanner sc...

    public static void main(String[] args) {         System.out.println("Welcome to the Future Value Calculator\n");         Scanner sc = new Scanner(System.in);         String choice = "y";         while (choice.equalsIgnoreCase("y")) {             // get the input from the user             System.out.println("DATA ENTRY");             double monthlyInvestment = getDoubleWithinRange(sc,                     "Enter monthly investment: ", 0, 1000);             double interestRate = getDoubleWithinRange(sc,                     "Enter yearly interest rate: ", 0, 30);             int years = getIntWithinRange(sc,                     "Enter number of years: ", 0, 100);             System.out.println();            ...

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
Active Questions
ADVERTISEMENT