1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jasenka [17]
3 years ago
9

The length, height, and width of a cube are 10, 7, and 5 cm respectively. Write a program that calculates the volume, perimeter,

and surface area of the cube. This problem has 5 points.
Computers and Technology
1 answer:
RideAnS [48]3 years ago
8 0

Answer:

// code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int length=10,height=7,width=5;

   // find the volume of

   int vol=length*height*width;

   // find the surface area

   int sa=2*(length*width+length*height+height*width);

   // find the perimeter

   int peri=4*(length+width+height);

   // print the volume

   cout<<"Volume is: "<<vol<<" cm^3."<<endl;

   // print the surface area

   cout<<"Surface area is: "<<sa<<" cm^2."<<endl;

   // print the perimeter

   cout<<"Perimeter is: "<<peri<<" cm."<<endl;

return 0;

}

Explanation:

Declare and initialize length=10, width=5 and height=7.calculate volume by multiply length, width and height and assign to variable "vol".Then find the surface area as 2*(length*width+length*height+height*width) and assign it to variable "sa".Then find the perimeter as 4*(length+width+height) and assign to variable "peri". Print the volume, perimeter and surface area.

Output:

Volume is: 350 cm^3.

Surface area is: 310 cm^2.

Perimeter is: 88 cm.

You might be interested in
which consumable would be used with a 3d printer? group of answer choices filament print ribbon toner cartridge ink
Anna35 [415]

Answer:

Filament

Explanation:

Filament is the plastics that 3d printers use to make objects.

7 0
1 year ago
Write a function named print_backward that accepts a String as its parameter and prints the characters in the opposite order. Fo
noname [10]

Answer:

Here is the JavaScript code:

function print_backward(string) {

   var revString = "";

   for (var i = string.length - 1; i >= 0; i--) {

       revString += string[i];  }

   return revString; }

document.write(print_backward("hello there!"))

Explanation:

The function print_backward takes a string as a parameter.

Then it creates a new variable revString to hold a resultant string in opposite order.

The loop iterates through the characters of given string parameter in reverse and adds each character of the string to revString in opposite order.

Then the function returns revString which is the string in opposite order.

document.write(print_backward("hello there!")) This statement calls print_backward method passing a string hello there! to the method in order to print/display the characters of string in opposite order.

Lets say the string is hello

Then the loop works as follows:

The variable i is initialized to string.length - 1

string.length returns the length of the string

The length of string is 5 as there are 5 characters in string hello.

Hence string.length - 1 = 5 -1 = 4. So i=4

The loop checks if the value of i is greater than or equals to 0. This is true because i=4

Then the program enters the body of the loop which has a statement:

revString += string[i]; this works as:

revString = revString + string[i];

As i = 4 So

At first iteration

revString = revString + string[4];

This means the last character of string hello is added to revString. The last character of hello is 'o'

revString = 'o'

The statement in loop body continues to execute and stops when the value of i becomes less than 0.

The value of is decremented by 1 i.e. i-- So i = 3

At second iteration

revString = revString + string[3];

This means the second from last character of string hello is added to revString. The second last character of hello is 'l'

revString = 'ol'

The value of is decremented by 1 i.e. i-- So i = 2

At third iteration

revString = revString + string[2];

This means the third from last character of string hello is added to revString. The third last character of hello is 'l'

revString = 'oll'

The value of is decremented by 1 i.e. i-- So i = 1

At fourth iteration

revString = revString + string[1];

This means the fourth from last character of string hello is added to revString. The fourth last character of hello is 'e'

revString = 'olle'

The value of is decremented by 1 i.e. i-- So i = 0

At fifth iteration

revString = revString + string[0];

This means the fifth from last character of string hello is added to revString. The fifth last character of hello is 'e'

revString = 'olleh'

The value of is decremented by 1 i.e. i-- and the loop breaks because the i>=0 evaluates to false.

So the program moves to the next statement:

return revString;

revString = 'olleh' is returned and the statement document.write(print_backward("hello")) prints olleh on output screen.

In the given example the string is hello there! So this works same like the explained example and prints the following output on screen:

Output:

!ereht olleh

3 0
3 years ago
Which binary number is equivalent to the decimal number 104?
ra1l [238]

B. 01101000

For future reference you can look up decimal to binary calculators online; or binary to decimal.

6 0
2 years ago
When is a wired connection preferred to a wireless connection by an end-user device?
harkovskaia [24]

Answer:

Option (b) When the end-user device will run an application that requires a dedicated connection to the network

Explanation:

  • Option (b) is the correct option.
  • When the user device requires a highly dedicated network environment to itself to run a web application that requires large download and upload speeds, bandwidth requirements then it prefers a wired connection than a wireless connection.
  • If the wireless signal is within the reach, then it advisable to go for a wireless connection than a wired connection. A wired connection requires other hardware equipments like a internet connection cable etc. which is not required in case of wireless connection. So, option (a) is wrong option.
  • WLAN NIC is a wireless interface network controller that connects to a wireless radio based network than a wired network.So, option (c) is wrong option.
  • Delay torrent network is designed to operate where continuous network connectivity is not available like extreme terrestrial spaces, space communications, inter planetary communications etc.So, option (d) is wrong option.
6 0
2 years ago
With "read" function, which one of the following statements is NOT correct? a.If the read is successful, the number of bytes rea
worty [1.4K]

Answer:

a. If the read is successful, the number of bytes read is returned.

b. If the end of file is encountered, 0 is returned.

Explanation:

A read function is one of the functions used in computer programming. A read function is used to read an information or data that was written before into a file.

If any portion of a regular file before to the end of file has not been written and the end of file is encountered the read function will return the bytes with value 0.

If read function has read some data successfully, it returns the number of bytes it read.

3 0
2 years ago
Other questions:
  • Choose all statements that identify the benefits of programming design.
    10·2 answers
  • Which action will help you protect data in your computer in case of an earthquake?
    7·2 answers
  • How to use javascript libraries in javascript code?
    9·1 answer
  • In a transaction-processing system (TPS), if the TPS database can be queried and updated while the transaction is taking place,
    12·1 answer
  • Write a query to show the price reduced by 10% for all products that are tables or entertainment centers with a standard price g
    10·1 answer
  • When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
    7·2 answers
  • Interactive television with video-on-demand capabilities changes how people watch television and how consumers access the Intern
    8·1 answer
  • dash is a set of communication standard using for transferring file information between computers in a network​
    5·1 answer
  • What are your two biggest strengths as a student? How will these strengths help you become a self-directed learner?
    13·2 answers
  • Meera has created a small program in Python. She wants to store elements of the same data type in an organized
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!