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
Nostrana [21]
3 years ago
10

Input two numbers and work out their sim, subtraction, multiplication, division, remainder, average and sum of the squares of th

e numbers.
Computers and Technology
1 answer:
nadezda [96]3 years ago
5 0

def ultimate_math (num1, num2):

try:

array_num = [num1, num2]

print (num1 + num2)

print (num1 - num2)

print (num1 * num2)

print (num1 / num2)

print (num1 % num2)

print ((num1 + num2) / (len(array_num)))

print ((num1**2) + (num2**2))

except ValueError:

return "Invalid Input"

user_num1 = float (input (" Please enter a num: "))

user_num2 = float (input (" Please enter a second num: "))

print (ultimate_math (user_num1, user_num2))

You might be interested in
Helloooooo people, thats all I just wanted to say :D​
Salsk061 [2.6K]

Answer:

Hi also thank you for the points very much appreciated.

6 0
3 years ago
Segmentation Faults Recall what causes segmentation fault and bus errors from lecture. Common cause is an invalid pointer or add
vfiekz [6]

Answer:

See Explanation

Explanation:

Q13. Line that caused the segmentation fault?

The segmentation fault was caused by line 15 i.e. scanf("%d",input);

Q14. How the line was fixed?

The reason for the segmentation fault is that the instruction to get input from the user into the integer variable "input" was not done correctly.

The correction to this is to modify scanf("d",input) to scanf("%d",input);

Q15. The bug?

The bug is that the method needs to return two value; the sum of the inputted numbers and the count of the inputted numbers.

However. it only returns the count of the inputted number.

So, the average is calculated as: 0/count, which will always be 0

How it was fixed?

First, change the method definition to: void and also include an array as one of its parameters.

<em>void read_values(double sum, double arr []) {</em>

Next:

<em>assign sum to arr[0] and values to arr[1]</em>

<em />

In the main method:

Declare an array variable: double arr [2];

Call the read_values function using: read_values(sum,arr);

Get the sum and values using:

<em>sum = arr[0];</em>

<em>values = arr[1];</em>

<em />

Lastly, calculate and print average:

<em>printf("Average: %g\n",sum/values);</em>

See attachment for complete modified program

Download txt
8 0
3 years ago
Which of the following would NOT be used to build websites with interactive capabilities? Active Server Pages (ASP) PHP (PHP: Hy
Oxana [17]

Answer: FORTRAN

Explanation: FORTRAN (FORmula TRANslator) was a amongst the first general purpose high-level programming language. It was particularly made for the numeric operation and scientific purpose. Therefore , it had no feature related to the interactive website designing because it served the purpose for computing the operations like scientific calculations etc. Thus , the correct option is FORTRAN.

4 0
4 years ago
Write a macro to change a decimal degrees (e.g. 245.678) to degrees, minutes, seconds (e.g. 245° 40' 40.8"). Input and output us
Brut [27]

Answer:

All the procedure is explained below step-by-step

  1. Press alt+F11 to open VBA in excel.
  2. Create a module and start entering the subroutine.
  3. The coding of subroutine is attached in the image.

For adding "RUN" button:

  1. Select a shape on the sheet for the button.(Insert > Shapes > Rectangle).
  2. Double click on the shape to add text and write "RUN".
  3. The button can be styled by adding colors and shadows.
  4. Now Assign macro to the button (Right click  > Assign macro).
  5. A window pane will appear, select the macro from This workbook list so that it may work properly when shared with others.
  6. Press OK.
  7. "RUN" button has been created and by pressing it the subroutine will work as required.

4 0
3 years ago
You interact with a program through its user
Schach [20]

Answer:

Explanation:

The user interface, in the industrial design field of human-computer interaction, is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine from the human end, whilst the machine simultaneously feeds back information that aids the operators' decision-making process. Examples of this broad concept of user interfaces include the interactive aspects of computer operating systems, hand tools, heavy machinery operator controls, and process controls. The design considerations applicable when creating user interfaces are related to or involve such disciplines as ergonomics and psychology.

Generally, the goal of user interface design is to produce a user interface which makes it easy, efficient, and enjoyable (user-friendly) to operate a machine in the way which produces the desired result. This generally means that the operator needs to provide minimal input to achieve the desired output, and also that the machine minimizes undesired outputs to the human.

6 0
3 years ago
Read 2 more answers
Other questions:
  • You have just used a command that produced some interesting output on the screen. You would like to save that information into a
    10·1 answer
  • 6. What are the two keyboard keys you can press at the same time to use the Copy command? (1.0 points)
    12·1 answer
  • A STUDENT can take many COURSES and a COURSE can have more than one STUDENT enrolled in the course. In this case, both the "stud
    5·1 answer
  • What are some of the unique benefits and challenges of flash drives as a way to store data?
    9·1 answer
  • Prensentation software allows user to?
    14·1 answer
  • You are a cleared employee. Your friend called and told you that he saw information about the classified XYZ program on the Inte
    10·1 answer
  • The type of e-cards that have an antenna built into them are __________ cards.
    10·2 answers
  • They have requested a 1- to 2-page memo that describes the hospital's protections against a ransomware attack.
    10·1 answer
  • Line installers must complete a four-year university degree program in order to be hired.
    5·2 answers
  • Grade Average Lab Assignment Purpose: The goal of this lab assignment is to learn how to use for loops and if/else commands. Wri
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!