A piece of wire is to be bent in the form of a rectangle to put around a picture frame. The length of the picture frame is 1.5 times the width. Write a program that prompts the user to input the length of the wire and outputs the length and width of the picture frame.
USING C++ language please
CODE:
#include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
double lenOfWire;
double lenPictureFrame = 0, widPictureFrame = 0;
//prompt to get the length of the wire
cout << "Enter the length of the wire: ";
//getting and storing the length of the wire
cin >> lenOfWire;
//using the formula of the perimeter of the
rectangle
// 2(l+b) = perimeter of the rectangle
// since the length is 1.5 times the
breadth
// hence equating it against the length of the
wire
widPictureFrame = (lenOfWire/2.5);
// determine the length of the picture frame
//once we get the width of the picture frame
lenPictureFrame = 1.5 * widPictureFrame;
//output to the console
cout << "The length of the picture frame is "
<< lenPictureFrame << " and the width is " <<
widPictureFrame;
return 0;
}
OUTPUT:
The area of a rectangle is the rectangle’s length times its width. Using the windows32 or windows64 framework, write an assembly program that asks for the length and width of two rectangles. The program should then tell the user which rectangle has the greater area or if the areas are the same.
Write a program that collects the dimensions of two rectangles. For each rectangle, the program collects the width and length. Then, the program should print one of the following messages depending on the relative values of the rectangle sizes: - Rectangle 1 is bigger than Rectangle 2. - Rectangle 1 is the same size as Rectangle 2. - Rectangle 2 is bigger than Rectangle 1. For example, consider the sample output of the proposed program (the bold font represents user...
Write a short application that computes the perimeter of a rectangle. It should allow the user to input the length and width of the rectangle as a double. Java language.
Please write clearly. thanks! A wire with resistance R is bent to form a square with a side of length a and is placed in external magnetic field. Find a charge, which will pass through the wire after the square has been deformed into two identical squares (i) by applying a twist and (ii) without a twist A wire with resistance R is bent to form a square with a side of length a and is placed in external magnetic...
Write a Java program to find the perimeter of rectangle and ask the user to input length and width.
A piece of wire is bent to form a circle with radius r. It has a steady current I flowing through it in a counterclockwise direction as seen from the top (looking in the negative zdirection). (Figure 1) Part A What is Bz(0), the z component of B⃗ at the center (i.e., x=y=z=0) of the loop? Express your answer in terms of I, r, and constants like μ0 and π. Bz(0) = SubmitHintsMy AnswersGive UpReview Part
Please, Could someone please write me an assembly language program for PEP8 which outputs the perimeter of a rectangle? perim=(width+length)*2 ?
Using basic c++ write a separate code for each of the following: 1. Area Rectangle • Write a program that asks the user to enter length and width of a rectangle and then display the rectangles area. • Write the following functions • getLength – prompt the user to enter length and return that value as a double • getWidth – prompt the user to enter width and return that value as a double • getArea – This method should...
Problem: Given information about a circle, rectangle and a triangle, calculate the area of the shape from the information supplied. Write pseudocode to solve this problem and write a Python program that asks the user to input the required information for a shape and then calculates the area of the shape. Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1...
using python3 Write a Python program that will ask the user for: 1. The length of a rectangle. 2. The width of a rectangle and will print out the length of the diagonal of the rectangle. So your program should look like this: Please enter the length of the rectangle: Please enter the width of the rectangle: The diagonal of the rectangle is: So the user enters the length, width and then the answer is printed.