Answer:
a = float(input("Enter Side A: "))
b = float(input("Enter Side B: "))
c = float(input("Enter Side C: "))
d = float(input("Enter Side D: "))
e = float(input("Enter Side E: "))
area1 = 1.0* a * b
area2 = (a - c) * (d - e -b)
area3 = 0.5 * (a - c) * e
print ("Room Area: " + str(area1 + area2 + area3))
Explanation:
happy to help ^3^
Im going to say probably not, it wont be able to describe it but it'll search it up and show what others match the image
Hi,
I changed your program using some of the concepts you were trying to use. Hopefully you can see how it works:
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
short T;
cin >> T;
cin.ignore();
string str[100];
for(int i=0; i<T; i++)
{
getline(cin, str[i]);
}
for (int i = 0; i < T; i++)
{
stringstream ss(str[i]);
string tmp;
vector<string> v;
while (ss >> tmp)
{
// Let's capitalize it before storing in the vector
if (!tmp.empty())
{
transform(begin(tmp), end(tmp), std::begin(tmp), ::tolower);
tmp[0] = toupper(tmp[0]);
}
v.push_back(tmp);
}
if (v.size() == 1)
{
cout << v[0] << endl;
}
else if (v.size() == 2)
{
cout << v[0][0] << ". " << v[1] << endl;
}
else
{
cout << v[0][0] << ". " << v[1][0] << ". " << v[2] << endl;
}
}
return 0;
}
Answer:
Following are the python code to print the given pattern:
print('FOURTH') # using print method
for i in range(10): #using loop to count numbers
for j in range(10-i): # use loop to print asterisk value in reverse order
print("*", end=" ") #print value
print("") #using print method for space
Output:
Please find the attachment.
Explanation:
The description of the above python program can be described as follows:
- In the first line, use the print method, that print message "FOURTH".
- In the next line, two for loop is used in which the first loop counts the number to be print value, inside the loop another for loop is used.
- In this loop, it prints asterisk values in its reverse order and for new lines, it will use the print method with a single white space.