Questions
Python Program: Description Create an object-oriented program that uses inheritance to perform calculations on a rectangle...

Python Program:

Description
Create an object-oriented program that uses inheritance to perform calculations on a rectangle or a square.

Specifications

  • Use a Rectangle class that provides attributes to store the height and width of a rectangle. This class should also provide methods that calculate the perimeter and area of the rectangle.
  • Use a Square class that inherits the Rectangle class. This class should set the height and the width of the Rectangle superclass to the length that’s set in the Square subclass.
  • The program should determine whether the user wants to enter a rectangle or a square.
  • For a rectangle, the program should get the height and width from the user.
  • For a square, the program should get the length of the square from the user.

Sample Output (Your output should be similar or can be the same to the text in the following box)

Rectangle Calculator
Rectangle or square? (r/s): r
Height: 5
Width: 10
Perimeter: 30
Area: 50

Continue? (y/n): y

Rectangle or square? (r/s): s
Length: 5
Perimeter: 20
Area: 25

Continue? (y/n): n

Thank you for using my app.

In: Computer Science

A charge of -3.40 nC is placed at the origin of an xy-coordinate system, and a...

A charge of -3.40 nC is placed at the origin of an xy-coordinate system, and a charge of 1.60 nC is placed on the y axis at y = 4.50 cm .

a-If a third charge, of 5.00 nC , is now placed at the point x = 3.15 cm , y = 4.50 cm find the x and y components of the total force exerted on this charge by the other two charges. ?

b-Find the magnitude of this force.

c-Find the direction of this force.

In: Physics

For the last 7 years, Joseph has made deposits of ​$150.00 at the end of every...

For the last 7 years, Joseph has made deposits of ​$150.00 at the end of every year earning interest at 6 % compounded annually. If he leaves the accumulated balance for another 8 years at 5 % compounded semi dash annually comma what will the balance be in the​ account?

The balance will be $________.

In: Finance

You have been talking to a student from the engineering program at UBC who has also...

You have been talking to a student from the engineering program at UBC who has also taken up temporary residence at the North Pole in between active semesters of her studies. Because of her engineering background, the elves have given her the nickname “Casey Jones”. Casey scoffs at the α = .05 significance level that psychologists use in their hypothesis testing procedure. She tells you “That means you will, in the long run, make an error one time in twenty. If engineers had an error rate like that think of all the buildings and bridges and such that would be falling down! Why don’t you psychologists be more like engineers and set your error rate to something like one in a million instead of one in twenty?” Explain to Casey Jones why, in the context in which psychologists use it, an alpha level of one in twenty makes more sense than an alpha level of one in a million.

In: Math

Explain Diminishing Marginal Returns. How does that relate to Capital (K)? How does this explain why...

Explain Diminishing Marginal Returns. How does that relate to Capital (K)? How does this explain why smaller countries grow faster than bigger countries.

a. Draw a graph showing the relationship between GDP and Capital (K).

In: Economics

Filer Manufacturing has 7 million shares of common stock outstanding. The current share price is $73,...

Filer Manufacturing has 7 million shares of common stock outstanding. The current share price is $73, and the book value per share is $8. Filer Manufacturing also has two bond issues outstanding. The first bond issue has a face value of $75 million, has a 8 percent coupon, and sells for 98 percent of par. The second issue has a face value of $55 million, has a 9 percent coupon, and sells for 107 percent of par. The first issue matures in 23 years, the second in 7 years.

The most recent dividend was $4.5 and the dividend growth rate is 8 percent. Assume that the overall cost of debt is the weighted average of that implied by the two outstanding debt issues. Both bonds make semiannual payments. The tax rate is 30 percent.

Required: What is the company's WACC? (Do not round your intermediate calculations.)

A 12.79%

B 8.19%

C 7.69%

D 15.88%

E 7.94%

Please show work

In: Finance

In Python, Define an object-oriented class to represent a Sensorless Wheeled Robot, including: (a) class data...

In Python, Define an object-oriented class to represent a Sensorless Wheeled Robot, including:

(a) class data variables to store the robot’s x and y position.

(b) A class function or functions to move the robot by one distance unit in either positive or negative x, or positive or negative y dimensions. Include printed, informative output of each move and the resulting robot position

(c) A class function to navigate to the destination location by calling the class move functions (described above) • The destination object is passed in as a parameter to this function. • The obstacle position is also passed as a parameter to the function. • Reaching the destination does not require that the robot is rotated to ’face’ the destination in this model

In: Computer Science

construct flow chart for c program #include <stdio.h> #include <stdlib.h> #include <math.h> void brst(); void thight();...

construct flow chart for c program

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void brst();
void thight();
void wings();
void back();
void neck();
void menu();
void ex();

float price;
float total;
char choice;
int again;

void main()
{
menu();
}

void menu()
{
char choice = ' ' ;
  
printf("----------------------------------------------------------------------");
printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" && Please select the chicken part that you would like to purchase. && \n\n");
printf(" [A] Breast\n");
printf(" [B] Thigh\n");
printf(" [C] Wings\n");
printf(" [D] Back\n");
printf(" [E] Neck\n");
printf("\n");
printf(" [F] Exit\n\n");
printf("Enter your choice here : ");
scanf("%c", &choice);
printf("----------------------------------------------------------------------");
  
{
if ((choice) == 'A' )
brst();
else
if ((choice) == 'B')
thight();
else
if ((choice) == 'C')
wings();
else
if ((choice) == 'D')
back();
else
if ((choice) == 'E')
neck();
else
if ((choice) == 'F')
ex();
else
if ((choice) != 'A' , 'B' , 'C' , 'D' ,'E', 'F')
{
printf("\n");
system("clear");
menu();
}
}
}
void brst()
{
int choice = 0;
int quantity = 0;
int again = 0;

printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking Style $ \n\n");
printf(" && Please select the cooking that you would like && \n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");

printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
brst();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
//Allows user to choose whether to check-out or buy anything else.
scanf("%d", &again);
system("clear");
  
if (again == 1 )
brst();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (pieces): ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
brst();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
// Allows user to choose whether to check-out or buy anything else.
scanf("%d", &again);
system("clear");
  
if (again == 1 )
{
brst();
}
else
if (again == 2 )
{
menu();
}
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if (choice != 1 , 2 , 3 )
{
printf("\n\n\t\t Invalid Choice Entered\n\n");
ex();
}
}
}

void thight()
{
int choice;
int quantity;
int again;

printf(" Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking style $ \n\n");
printf(" && Please select the cooking style that you would like to purchase. &&\n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");
  
printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50* quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No :");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No :");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if (choice != 1 , 2 , 3)
{
printf("\n\n Invalid Choice Entered\n\n");
thight();
}
}

}

void wings()
{
int choice;
int quantity;
int again;


printf(" Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking style $ \n\n");
printf(" && Please select the cooking style that you would like to purchase. &&\n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");

printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n ", total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n ", total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2 )
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No :");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
  
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (pieces): ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No :");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2 )
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
  
}
}
else
if (choice != 1 , 2 )
{
printf("\n\n Invalid Choice Entered\n\n");
wings();
}
}
}

void back()
{
int choice = 0;
int quantity = 0;
int again = 0;

printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking Style $ \n\n");
printf(" && Please select the cooking that you would like && \n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");

printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
  
if (again == 1 )
back();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
//Allows user to choose whether to check-out or buy anything else.
scanf("%d", &again);
system("clear");
  
if (again == 1 )
back();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (KG): ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
back();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
// Allows user to choose whether to check-out or buy anything else.
scanf("%d", &again);
system("clear");
  
if (again == 1 )
{
back();
}
  
else
if (again == 2 )
{
menu();
}
  
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if (choice != 1 , 2 , 3 )
  
printf("\n\n\t\t Invalid Choice Entered\n\n");
ex();
}
}

void neck()
{
int choice = 0;
int quantity = 0;
int again = 0;
  
printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking Style $ \n\n");
printf(" && Please select the cooking that you would like && \n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");

printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
  
if (again == 1 )
neck();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 2)
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
//Allows user to choose whether to check-out or buy anything else.
scanf("%d", &again);
system("clear");
  
  
if (again == 1 )
neck();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (KG): ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
scanf("%d", &again);
system("clear");
  
if (again == 1 )
neck();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2] No : ");
// Allows user to choose whether to check-out or buy anything else.
scanf("%d", &again);
system("clear");
  
if (again == 1 )
{
neck();
}
else
if (again == 2 )
{
menu();
}
  
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if (choice != 1 , 2 , 3 )
{
printf("\n\n\t\t Invalid Choice Entered\n\n");
ex();
}
}
}

void ex() // Exit Screen
{
printf("\n");
printf(" Thank You Very Much \n ");
printf(" && Please come again. && \n\n");
}

In: Computer Science

Who is Baulmol and what is his theory? Please explain in a simple and understandable manner.

Who is Baulmol and what is his theory?

Please explain in a simple and understandable manner.

In: Economics

Activity-Based Costing Define activity-based costing (ABC) systems. What benefits does implementing an ABC system bring to...

  1. Activity-Based Costing Define activity-based costing (ABC) systems. What benefits does implementing an ABC system bring to the company? Explain at least two benefits. What are the disadvantages to implementing an ABC system? List and explain at least two. Would the proposed changes make ABC a universally applicable costing method in your opinion? Why or why not? Elaborate your response.

In: Accounting

particles undergoing diffusion move a few millimeters per hour. In reality, particles are traveling around 500...

particles undergoing diffusion move a few millimeters per hour. In reality, particles are traveling around 500 m/s. The slow overall movement is because they collide with other particles very frequently. (density of water =1000 kg/m^3, Avogadro's # = 6.022x10^23 particles/mole, mass of the earth =5.97 x10^24 kg) using Xrms = sqrt(2Dt)

a. Estimate how far a water molecule travels before colliding with another water molecule.

b. How much time is in between each collision?

c. How many collisions occur for a molecule that diffuses 1 mm in 1 hour? d. Use your estimates from a, b, and c to figure out how many times a water molecule moves away from its starting point and how many times it moves towards it to end up 1 mm away after 1 hour.

In: Chemistry

The time of flight of a ball thrown horizontally change if the initial velocity change? If...

The time of flight of a ball thrown horizontally change if the initial velocity change? If it does why?

In: Physics

How would you expect India’s export orientation policy of recent decades to have affected the economic...

How would you expect India’s export orientation policy of recent decades to have affected the economic welfare of (i) China, (ii) the US

In: Economics

Exercise 6-12 The Flint Inc., a manufacturer of low-sugar, low-sodium, low-cholesterol TV dinners, would like to...

Exercise 6-12 The Flint Inc., a manufacturer of low-sugar, low-sodium, low-cholesterol TV dinners, would like to increase its market share in the Sunbelt. In order to do so, Flint has decided to locate a new factory in the Panama City area. Flint will either buy or lease a site depending upon which is more advantageous. The site location committee has narrowed down the available sites to the following three very similar buildings that will meet their needs.

Building A: Purchase for a cash price of $618,900, useful life 27 years.

Building B: Lease for 27 years with annual lease payments of $71,820 being made at the beginning of the year.

Building C: Purchase for $652,700 cash. This building is larger than needed; however, the excess space can be sublet for 27 years at a net annual rental of $6,430. Rental payments will be received at the end of each year. The Flint Inc. has no aversion to being a landlord.

In which building would you recommend that The Flint Inc. locate, assuming a 12% cost of funds? (Round factor values to 5 decimal places, e.g. 1.25124 and final answer to 0 decimal places, e.g. 458,581.)

Net Present Value

Building A: $

Building B: $

Building C: $

The Flint Inc. should locate itself in:

In: Accounting

Why is it important to prepare a financial budget? Explain what is meant by the term...

Why is it important to prepare a financial budget?

Explain what is meant by the term "time value of money". For example, why might it be better to receive $8 today, over receiving a promise of $9 seven years from now?

How should one consider the time value of money when planning for retirement? Please share examples within your response.

In: Operations Management