Question

Question Completion Status: QUESTION 13 Suppose that we reach a point in algorithm where we then to decide to execute one of
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Here's pseudo code for our program :

See, what's going in this :

  • we take input x
  • we use conditional statement(if-else) to perfrom statement execution as per given conditions.
x = int(input())

if(x >= 0)
{
    statement1;
    statement2;
    statement3;
}else {
    statement4;
    statement5;
}

2.As you have not mentioned any specific language, So, I am writing code in C++.

#include<iostream>
using namespace std;
int main()
{
    float totalAmount = 0;
    float totalPower = 0;
    float monthPower;
    for(int i = 1; i <= 12; i++)
    {
        cout<<"\nEnter electicity used in month "<<i<<" :";
        cin>>monthPower;

        if((totalPower + monthPower) <= 1000)
            cout<<"\nThis month's total charge is : "<<monthPower*0.06;
        else if (totalPower <= 1000 && totalPower + monthPower > 1000)
        {
            float temp = (totalPower + monthPower - 1000)*0.08 + (1000 - totalPower)*0.06;
            cout<<"\nThis month's total charge is : "<<temp;
        }
        else cout<<"\nThis month's total charge is : "<<monthPower*0.08;
        totalPower += monthPower;
    }
    if(totalPower <= 1000)
        totalAmount = totalPower * 0.06;
    else totalAmount = (totalPower - 1000)*0.08 + (1000*0.06);
    cout<<"\nTotal Power used : "<<totalPower;
    cout<<"\ntotal charges = "<<totalAmount;

}

Output :

Enter electicity used in month 1 :100 This months total charge is : 6 Enter electicity used in month 2 :100 This months tot

Like, if this helped :)

Add a comment
Know the answer?
Add Answer to:
Question Completion Status: QUESTION 13 Suppose that we reach a point in algorithm where we then...
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
  • QUESTION 1 In an R-L-C circult, the voltage amplitude accross the resistor is VR-2000, the resistance...

    QUESTION 1 In an R-L-C circult, the voltage amplitude accross the resistor is VR-2000, the resistance is R-1600 and the phase angle between the current and the source voltage is 36,870 with the voltage source lagging the current. The angular frequency is w-1200 radls and the inductance is L-0.2H a) Find impedance Z b) Find the capacitance (Note: To keep the calculations, neat and simple, please take sin(36.87°) - 0.6 COS(36.870;= 0.8 and tan( 36.87.75 For the toolbar, press ALT+F10...

  • Remaining Time: 2 hours, 47 minutes, 15 seconds. Question Completion Status: Path:p QUESTION 25 Consider the...

    Remaining Time: 2 hours, 47 minutes, 15 seconds. Question Completion Status: Path:p QUESTION 25 Consider the circuit below and answer the following questions. In this sketch, V=6 V, R=3000, and C=10 micro-F. C a) What is the maximum charge the capacitor can store in this circuit? b) How much energy will the capacitor store when it holds the maximum charge? c) How long will it take to charge the capacitor to half its maximum charge? Assume it starts with no...

  • Remaining Time: 1 hour, 01 minute, 06 seconds. Question Completion Status: Antioxidants QUESTION 18 Match the...

    Remaining Time: 1 hour, 01 minute, 06 seconds. Question Completion Status: Antioxidants QUESTION 18 Match the description and examples provided with the categories in which they be Programmed. B. Aging process is largely determined by environment and behavior. The aging process is largely determined by genes and genetics says that normal aging follows a pre-determined plan. • says that the aging process cannot be modified. . says that the aging process can be modified. A. Unprogrammed B. Programmed QUESTION 19...

  • Check my work Lenny Florita, an unmarried employee, works 52 hours in the week ended January...

    Check my work Lenny Florita, an unmarried employee, works 52 hours in the week ended January 12. His pay rate is $12 per hour, and his wages have deductions for FICA Social Security, FICA Medicare, and federal income taxes. He claims three withholding allowances. Compute his regular pay, overtime pay (Lenny earns $18 per hour for each hour over 40 per week), and gross pay. Then compute his FICA tax deduction (6.2% for the Social Security portion and 1.45% for...

  • plz fast answers for both Question Completion Status: 1 2 3 4 5 8 9 10...

    plz fast answers for both Question Completion Status: 1 2 3 4 5 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 QUESTION 21 A bacterial culture grows exponentiall at a rate of 6.4% per hour. If the culture present total is at 250,000 cultures. What was the initial amount 10 hours ago. Write the equation for the amount of cultures using the initial amount TT TT Paragraph Arial 3 (12pt) T Q T...

  • mining time: 3 hours, 10 minutes, 13 seconds. estion Completion Status: Path:p Words:0 QUESTION 102 Charlie...

    mining time: 3 hours, 10 minutes, 13 seconds. estion Completion Status: Path:p Words:0 QUESTION 102 Charlie Company uses a perpetual inventory system. During May, the following transactions and events occurred. May 13 Sold 8 motors at a cost of $45 each to Scruffy Brothers Supply Company terms 4/10, 1/30. The motors cost Charlie $26 each May 16 One defective motor was returned to Charlie May 23 Received payment in full from Scruffy Brothers. Round to nearest dollar. Instructions Journalize the...

  • X Blackboard + → XCO Question Completion Status: Ending stockholders' equity may be found in the:...

    X Blackboard + → XCO Question Completion Status: Ending stockholders' equity may be found in the: A A. statement of retained earnings . B. balance sheet C. income statement OD. Two of the above E. None of these QUESTION 10 Net income may be found in the: A balance sheet and income statement OB. Income statement and statement of retained earnings C. Income statement and balance sheet D. balance sheet and statement of retained earnings E. None of these. QUESTION...

  • please Help me!! Remaining Time: 3 hours, 11 minutes, 53 seconds. Question Completion Status: QUESTION 1...

    please Help me!! Remaining Time: 3 hours, 11 minutes, 53 seconds. Question Completion Status: QUESTION 1 The following information is for Bright Eyes Auto Supplies: Bright Eyes Auto Supplies Balance Sheet December 31, 2015 $ 40,000 80,000 100,000 140,000 180,000 250.000 Accounts Payable Salaries and Wages Payable Mortgage Payable Total Liabilities Cash Prepaid Insurance Accounts Receivable Inventory Land Held for Investment Land Buildings $200,000 Less Accumulated Depreciation (60.000 Trademark Total Assets $ 130,000 50,000 150.000 330,000 Common Sock Retained Earnings...

  • in java plz amaining Time: 1 hour, 49 minutes, 15 seconds. Jestion Completion Status: Write a...

    in java plz amaining Time: 1 hour, 49 minutes, 15 seconds. Jestion Completion Status: Write a program that asks the user for an input file name, open, read ar number of students is not known. For each student there is a name and and display a letter grade for each student and the average test score fc • openFile: This method open and test the file, if file is not found and exit. Otherwise, return the opened file to the...

  • Remaining Time: 57 minutes, 05 seconds Less than half of the team Question Comeletion Status Question...

    Remaining Time: 57 minutes, 05 seconds Less than half of the team Question Comeletion Status Question 10 Save A You have a project to be completed in 12 months. The budget for the project is 100.000 USD. Six months have passed, and 60.000 USD has been spent. On closer review, you find that only 40% of the work has become to date. Based on these figures, answer the following questions to receive full grade you must show your work 1....

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
ADVERTISEMENT