In this module you learned about advanced modularization techniques. You learned about the advantages of modularization and how proper modularization techniques can increase code organization and reuse.
Create the PYTHON program allowing the user to enter a value for one edge of a cube(A box-shaped solid object that has six identical square faces).
Prompt the user for the value. The value should be passed to the 1st and 3rd functions as arguments only.
There should be a function created for each calculation
One function should calculate the surface area of one side of the cube. The value calculated is returned to the calling statement and printed.
One function should calculate the surface area of the whole cube(You will pass the value returned from the previous function to this function) and the calculated value results printed.
One function should calculate the volume of the cube and print the results.
Make a working version of this program in PYTHON.

Answers

Answer 1

Answer:

Following are the code to the given question:

def getSAOneSide(edge):#defining a method that getSAOneSide that takes edge patameter

   return edge * edge#use return to calculate the edge value

def getSA(SA_one_side):#defining a method that getSA that takes SA_one_side patameter

   return 6 * SA_one_side#use return to calculate the SA_one_side value

def volume(edge):#defining a method that volume that takes edge patameter

   return edge * edge * edge#use return to calculate edge value

edge = int(input("Enter the length of edge of the cube:\n"))#defining edge variable that input value

SA_one_side = getSAOneSide(edge)#defining SA_one_side that holds getSAOneSide method value

print("Surface area of one side of the cube:", SA_one_side)

surfaceArea = getSA(SA_one_side)#defining a surfaceArea that holds getSA method value

print("Surface area of the cube:", surfaceArea)#print surfaceArea value

vol = volume(edge)#defining vol variable that holds Volume method value

print("Volume of the cube:", vol)#print vol Value

Output:

Please find the attached file.

Explanation:

In the code three method "getSAOneSide, getSA, and volume" method is declared that takes a variable in its parameters and use a return keyword that calculates and return its value.

In the next step,edge variable is declared that holds value from the user and defines three variable that holds method value and print its value with the message.

In This Module You Learned About Advanced Modularization Techniques. You Learned About The Advantages

Related Questions

Write an application that inputs a five digit integer (The number must be entered only as ONE input) and separates the number into its individual digits using MOD, and prints the digits separated from one another. Your code will do INPUT VALIDATION and warn the user to enter the correct number of digits and let the user run your code as many times as they want (LOOP). Submit two different versions: Using the Scanner class (file name: ScanP2)

Answers

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 int n, num;

 Scanner input = new Scanner(System.in);

 System.out.print("Number of inputs: ");

 n = input.nextInt();

 LinkedList<Integer> myList = new LinkedList<Integer>();

 for(int i = 0; i<n;i++){

     System.out.print("Input Integer: ");

     num = input.nextInt();

     while (num > 0) {

     myList.push( num % 10 );

     num/=10;

     }

     while (!myList.isEmpty()) {

         System.out.print(myList.pop()+" ");

     }

     System.out.println();

     myList.clear();

 }

}

}

Explanation:

This declares the number of inputs (n) and each input (num) as integer

 int n, num;

 Scanner input = new Scanner(System.in);

Prompt for number of inputs

 System.out.print("Number of inputs: ");   n = input.nextInt();

The program uses linkedlist to store individual digits. This declares the linkedlist

 LinkedList<Integer> myList = new LinkedList<Integer>();

This iterates through n

 for(int i = 0; i<n;i++){

Prompt for input

     System.out.print("Input Integer: ");

This gets input for each iteration

     num = input.nextInt();

This while loop is repeated until the digits are completely split

     while (num > 0) {

This adds each digit to the linked list

     myList.push( num % 10 );

This gets the other digits

     num/=10;

     }

The inner while loop ends here

This iterates through the linked list

     while (!myList.isEmpty()) {

This pops out every element of thelist

         System.out.print(myList.pop()+" ");

     }

Print a new line

     System.out.println();

This clears the stack

     myList.clear();

 }

seven and two eighths minus five and one eighth equals?

Answers

Answer: 2.125

Explanation

What is computer code?
A. Java Script
B. XML
C. HTML
D. Any programming language

Answers

Answer:

D

Explanation:

how to make an app according to peoples will

Answers

Answer:

Follow these steps to create your own app:

1)Choose your app name.

2)Select a color scheme.

3)Customize your app design.

4)Choose the right test device.

5)Install the app on your device.

6)Add the features you want (Key Section)

7)Test, test, and test before the launch.

8)Publish your app.

Explanation:

(!!_!!)

What is a geam in the ggplot2 system?
a) a plotting object like point, line, or other shape
b) a method for making conditioning plots
c) a method for mapping data to attributes like color and size
d) a statistical transformation

Answers

Answer:

a) a plotting object like point, line, or other shape

Explanation:

A geom in the ggplot2 system is "a plotting object like point, line, or other shape."

A Geom is used in formulating different layouts, shapes, or forms of a ggplot2 such as bar charts, scatterplots, and line diagrams.

For example some different types of Geom can be represented as geom_bar(), geom_point(), geom_line() etc.

A capacitor of capacitance 102/π µF is connected across a 220 V, 50 Hz A.C. mains. Calculate the capacitive reactance, RMS value of current and write down the equations of voltage and current.

Answers

Answer:

The capacitive reactance will be "100Ω" and RMS value of current is "2.2 A". A further explanation is provided below.

Explanation:

Given:

[tex]C =\frac{10^2}{\pi}\times 10^{-6} \ F[/tex]

[tex]V_{RMS}=220 \ V[/tex]

[tex]f = 50 \ Hz[/tex]

Now,

The capacitive reactance will be:

⇒ [tex]X_c=\frac{1}{\omega C} =\frac{1}{2 \pi f C}[/tex]

                   [tex]=\frac{1}{2\times \pi\times 50\times \frac{10^{-4}}{\pi} }[/tex]

                   [tex]=100 \ \Omega[/tex]

RMS value of current will be:

⇒ [tex]I_{RMS}=\frac{V_{RMS}}{X_c}[/tex]

             [tex]=\frac{220}{100}[/tex]

             [tex]=2.2 \ A[/tex]

So that,

⇒ [tex]V_m=220\times \sqrt{2}[/tex]

         [tex]=311 \ V[/tex]

⇒ [tex]I_m=2.2\times \sqrt{2}[/tex]

         [tex]=3.1 \ A[/tex]

hence,

The equation will be:

⇒ [tex]\nu=311 sin31 \ 4t[/tex]

and,

⇒ [tex]i=3.1 sin(314t+\frac{\pi}{2} )[/tex]

Which of the following statements regarding the SAP Hana product implemented by Under Armour is NOT true?
A. All of the statements are true.
B. The program allows legacy silos to remain intact.
C. The program can run across platforms and devices.
D. The program provides real-time results.

Answers

Answer:A

Explanation:i need points

_ is a term used for license like those issues by creative commons license as an alternative to copyright

Answers

, . , .

Explanation:

'

some machine/items/gadget having only hardware​

Answers

Yeh it’s becoz they work with hardware that’s why

You are the IT administrator for a small corporate network. The employee in Office 1 needs your assistance managing files and folders. Your task is to use the command prompt to complete the following:

a. Create the D:​\​utilities​\​recover directory. Use the md or mkdir command to create (make) a directory.
b. Delete the D:​\​software​\​arch98 directory and all of its files.
c. Use the rd command to delete (remove) a directory.
d. Use the /s switch to remove the directory and all of its contents at once.

Answers

Answer:

(a) mkdir /d D:\utilities\recover    

     or

    mkdir D:\utilities\recover    

(b) rd  /s  D:​\software​\arch98

Explanation:

(a) To make a new directory we use the md or mkdir command followed by the name of the directory as follows;

mkdir [name_of_directory]

The name of the directory could also be a relative or absolute path depending on the request.

In the task, the specified directory uses an absolute path given as D:​\​utilities​\​recover. This path is in a drive D. Therefore, if you are in another drive different than D, to run this command, it is a great idea to do that with the /d switch.

In summary:

i. if in drive D, to make a directory D:\utilities\recover, type the following command;

mkdir  D:\utilities\recover    

ii. if otherwise in a different drive, type the following command.

mkdir /d D:\utilities\recover

(b) To delete a directory, we use the rd or rmdir command. If the directory has contents that also need to be deleted, we use the switch /s alongside the rd or rmdir.

In the task given, the directory to be deleted is D:\software\arch98. This includes deleting all of its files too. To do this, type the following command;

rd /s D:\software\arch98

Frames control what displays on the Stage, while keyframes help to set up

Answers

Answer: A keyframe is a location on a timeline which marks the beginning or end of a transition. So for example, you have a movie and it transitions to another scene, keyframes tell it when and where to start the transition then when and where to stop the transition.

Write an algorithm that accepts two numbers,
divide the first number by the second and display the
quotient

Answers

Let’s write the algorithm in the form of a pseudocode!

Pseudocode:Quotient_of_Two_Number
Declare: num1, num2, quotient
START
Display (Enter a number)
Read num1
Display (Enter a number)
Read num2
quotient = num1/num2
Print (“Quotient”)
STOP

Used for monitoring web activity by users to make sure that sensitive information won't leave the building.

A, Web server
B, FTP server
C, POP server
D, Proxy server ​

Answers

Answer: PROXY

Explanation:

The basic objective of the web server is to store, process and deliver web pages to the users.

FTP server is to allow users to upload and download files. An FTP server is a computer that has a file transfer protocol (FTP) address and is dedicated to receiving an FTP connection. FTP is a protocol used to transfer files via the internet between a server (sender) and a client (receiver)

pop provides access via an Internet Protocol (IP) network for a user client application to a mailbox (maildrop) maintained on a mail server

proxy server is a system that isolates internal clients from the servers by downloading and storing files on behalf of the clients. it intercepts requests for web-based or other resources that come from

1.               The smallest unit in a digital system is a​

Answers

Answer:

a bit

Explanation:

<3

What does the abbreviation BBC stands for?

Answers

Answer:

British Broadcasting Corporation Microcomputer System

Explanation:

The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by the Acorn Computer company in the 1980s for the BBC Computer Literacy Project.

Answer:

British Broadcasting Corporation

Explanation:

This is a UK company which provides television and radio news in over 40 languages. This is the computer related meaning, there are other meanings to the abbreviation but they seem irrelevant in this case.

Hope this information was of any help to you. (:

What is the meaning of negative impact in technology

Answers

Answer:

the use of criminal thought by the name of education

Other Questions
two dice are rolled write the sample space and number of sample points also write events and number of sample points in the event according to the given condition sum of the digits of upper faces is a prime number , sum of the digits on the upper face is a multiple of 5 , sum of the digits on the upper face is 25 and digit on the upper face at the first die is less then then the digit on the second die Anyone know the answer to this? 2x^2 + 3x - 12 when x = 5 help pls Which of the following best describes what would have to change totransform a direct democracy into a parliamentary democracy?A. An individual would have to take direct control of the government.B. Executive leaders would have to be chosen from the legislativebranch.C. An elite group would have to take control of the government.D. An assembly of all citizens would have to take control from anelected group crivez les phrases au pass compos et ajoutez les adverbes entre parenthses. Il pleut. (longtemps) Evaluate the expression below when y = 3. If needed, answer as a fraction or a decimal.y5y+2 PLS HURRY AND NO LINKS PLEASEIf a long tail is a dominant characteristic, in which case is the characteristic of a long tail definitely expressed? A when both parents have a long tailB when neither allele contains instructions for a long tailC when at least one parent has a long tailD when at least one allele contains instructions for a long tail Helppppppppppppppp meeeeeeeeeeeeeeeeeeeeeeeee how much work is done when you lift an object that weighs 150 N to a height of 5 meters If is in standard position and -180 < Which two sentences in this excerpt from Theodore Dreiser's "My Brother Paul" are examples of characterization that suggest Paul is a superstitious person?Of all those who had been so lavish in their greetings and companionship earlier in his life, scarcely one, so far as I could make out, found him in that retired world to which he was forced. One or two pegged-out actors sought him and borrowed a little of the little that he had; a few others came when he had nothing at all. His partners, quarreling among themselves and feeling that they had done him an injustice, remained religiously away. He found, as he often told my sister, broken horse-shoes (a "bad sign"), met cross-eyed women, another "bad sign," was pursued apparently by the inimical number thirteenand all these little straws depressed him horribly. Finally, being no longer strong enough to be about, he took to his bed and remained there days at a time, feeling well while in bed but weak when up. For a little while he would go "downtown" to see this, that and the other person, but would soon return. One day on coming back home he found one of his hats lying on his bed, accidentally put there by one of the children, and according to my sister, who was present at the time, he was all but petrified by the sight of it. To him it was the death-sign. Some one had told him so not long before!!! Which element of a command economy is also used in a mixed economy PLEASE HELP! WILL MARK BRAINIEST!!I have a question regarding wording of some instructions. I dont want anyone to give me answers or anything, but I just need some clarification on the portion of the instructions below that is in ALL CAPS:On the next slide, using pictures, video and your own words, discuss fitness and nutrition while exploring the following three concepts: - INCLUDE INTERNAL AND EXTERNAL INFLUENCES OF OVERALL HEALTH- Demonstrate positive and negative effects of influences on health.- Demonstrate understanding of balance between the three aspects of the Health Triangle.I have been trying to figure it out for the last 1 hour and really need help. My teacher is off and this is due soon. I'll be sure to mark you brainliest if you give a good response!! No links please!Thanks!!!!! Which is an example of an ecosystem change that resulted from human activity? What is the main conflict in the story?Nene wants a tribal wedding, but Nnaemeka wants an urban ceremony.The village elders want Okeke to disown Nnaemeka, but he does not want to.Nnaemekas father wants him to marry a neighbor, but Nnaemeka marries Nene.Nnaemekas father thinks that women should not teach, but Nene is a dedicated teacher. choose the pair of sets which is equivalent When deciding on new environmental policiesand laws, which term is used to describe thecomparison between benefits and costs ofhuman activities? In the diagram, PN is perpendicular bisector of AB and is also the ange bisector of what textual clues are included in the boston massacre picture? 2. Dado un nmero, la suma de su mitad, su doble y su triple es 55. Qu nmero es?