For two integers m and n, their GCD(Greatest Common Divisor) can be computed by a recursive function. Write a recursive method gcd(m,n) to find their Greatest Common Divisor. Once m is 0, the function returns n. Once n is 0, the function returns m. If neither is 0, the function can recursively calculate the Greatest Common Divisor with two smaller parameters: One is n, the second one is m mod n. Although there are other approaches to calculate Greatest Common Divisor, your program should follow the instructions of this question, otherwise you will not get the credit. Then write a testing program to call the recursive method.

Answers

Answer 1

Answer:

In Python:

def gcd(m,n):

if n == 0:

 return m

elif m == 0:

    return n

else:

 return gcd(n,m%n)

Explanation:

This defines the function

def gcd(m,n):

If n is 0, return m

if n == 0:

 return m

If m is 0, return n

elif m == 0:

    return n

If otherwise, calculate the gcd recursively

else:

 return gcd(n,m%n)

To call the function to calculate the gcd of say 15 and 5 from main, use:

gcd(15,5)


Related Questions

1-(50 points) The function sum_n_avgcomputes the sum and the average of three input arguments and relays its results through two output parameters.a)Write a prototype for a function sum_n_avgthat accepts three double-type inputparameters and returns two output parameters through reference.b)Write the function definition for function sum_n_avg. The function definition is where the actual computations are performed.c)Write a function call in main ()forsum_n_avg. The function call can look like below free

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

double *sum_n_avg(double n1, double n2, double n3);

int main () {

   double n1, n2, n3;

   cout<<"Enter 3 inputs: ";

   cin>>n1>>n2>>n3;

   double *p;

   p = sum_n_avg(n1,n2,n3);

   cout<<"Sum: "<<*(p + 0) << endl;

   cout<<"Average: "<<*(p + 1) << endl;

  return 0;

}

double *sum_n_avg(double n1, double n2, double n3) {

  static double arr[2];

  arr[0] = n1 + n2 + n3;

  arr[1] = arr[0]/3;

  return arr;

}

Explanation:

This defines the function prototype

double *sum_n_avg(double n1, double n2, double n3);

The main begins here

int main () {

This declares variables for input

   double n1, n2, n3;

This prompts the user for 3 inputs

   cout<<"Enter 3 inputs: ";

This gets user inputs

   cin>>n1>>n2>>n3;

This declares a pointer to get the returned values from the function

   double *p;

This passes n1, n2 and n3 to the function and gets the sum and average, in return.

   p = sum_n_avg(n1,n2,n3);

Print sum and average

   cout<<"Sum: "<<*(p + 0) << endl;

   cout<<"Average: "<<*(p + 1) << endl;

  return 0;

}

The function begins here

double *sum_n_avg(double n1, double n2, double n3) {

Declare a static array

  static double arr[2];

Calculate sum

  arr[0] = n1 + n2 + n3;

Calculate average

  arr[1] = arr[0]/3;

Return the array to main

  return arr;

}

You have a spreadsheet with population counts for major cities in the United States. Population counts are given in different columns to show breakdown by age groups and gender. The names of cities are listed in rows. You need the population count in column 45 for the city in row 30. What tool could you use to navigate to the cell quickly?

filter

sort

locate

replace

Answers

Answer:

The answer is C. Locate

Explanation: Got it right on edg please mark brainliest

Which of the following is true about media production? A. All media elements contain a certain type of editorial viewpoint. B. Producing a media text involves both print and images C. Every type of media has a different set of tools and devices available. D. Media producers are all trying to confuse their audience

Answers

Answer:

C

Explanation:

Every form of media has different resources.

Parts of a computer software

Answers

Answer:

I think application software

utility software

networking software

does anyone play r0bIox

Answers

Answer:

Ah, okay okay, I know that game seems like a MEME, but it's actually good. I know a lot of kids play it and this community is filled with people...

....is the process whereby you transfer a file from your computer to the Internet.​

Answers

File transfer protocol is the process whereby you transfer a file from your computer to the Internet.​

Answer:

A post is the process whereby you transfer a file from your computer to the Internet.​

Explanation:

Usually, when you post something from the internet, you would get a file from your device, and then post it by the way of your choice. For example, let's say I'm asking a question on Brainly, and I want to post a picture of a graph of a linear function. I would have to get the saved photo from my computer, upload it to the Brainly, and click "ASK YOUR QUESTION". So, a post is the process whereby you transfer a file from your computer to the Internet.​ Hope this helps!

Implement your interface from Chapter using event handling In Chapter your assignment was to Design a universal remote control for an entertainment system (cable / TV, etc). Create the interface as an IntelliJ project. Or to design the telephone interface for a smartphone. Also, create the interface as an IntelliJ project In this assignment, you need to have event listeners associated with the components on the GUI.
The assignment cannot be created using the GUI Drag and Drop features in NetBeans. You must actually code the GUI application using a coding framework similar to one described and illustrated in chapter on GUI development in the courses textbook.
In this assignment you need to have event listeners associated with the components on the GUI. This assignment is about creating a few event handlers to acknowledge activity on your interface. Acknowledgment of activity can be as simple as displaying a text message when an event occurs with a component on your interface such as; a button is pressed, a checkbox or radio button is clicked, a slider is moved or a combo box item is selected.

Answers

Too much to read,Thanks for the points

your computer has been running slowly and you suspect it because its is low on memory. you review the hardware configuration and find that computer has only 4gb of ram. how can you determine how much memory your computer should have to run properly?​

Answers

By downloading software that is capable of checking live Ram usage/need. GIVE BRAINLIST

⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌
⠀⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌
⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌
⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪
⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡
⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐
⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔
⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘
⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎
⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗
⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷
⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟
⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰
⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊
⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌
⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁
⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌⠀
⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀⠀
⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟
⢀⢂⢑⠀⡂⡃⠅⠊⢄⢑⠠⠑⢕⢕⢝⢮⢺⢕⢟⢮⢊⢢⢱⢄⠃⣇⣞⢞⣞⢾
⢀⠢⡑⡀⢂⢊⠠⠁⡂⡐⠀⠅⡈⠪⠪⠪⠣⠫⠑⡁⢔⠕⣜⣜⢦⡰⡎⡯⡾⡽

Answers

Answer:

nice................

Answer:

24

Explanation:

Note that common skills are listed toward the top, and less common skills are listed toward the bottom. According to O*NET, what are common skills needed by Secondary School Special Education Teachers? Check all that apply.

instructing
installation
learning strategies
repairing
active listening
technology design

Answers

Answer:

A. Instucting   C. Learning Strategies   E. Active Listening

Explanation:

Got it right on assignment

Write a Python program that allows the user to enter any number of non-negative floating-point values. The user terminates the input list with any negative value. The program then prints the sum, average (arithmetic mean), maximum, and minimum of the values entered. Algorithm: Get all positive numbers from the user Terminate the list of numbers when user enters a negative

Answers

Answer:

The program in Python is as follows:

nums = []

isum = 0

num = int(input("Num: "))

while num >= 0:

   isum+=num

   nums.append(num)

   num = int(input("Num: "))

   

print("Sum: ",isum)

print("Average: ",isum/len(nums))

print("Minimum: ",min(nums))

print("Maximum: ",max(nums))

Explanation:

My solution uses list to answer the question

This initializes an empty list, num

nums = []

This initializes the sum of the input to 0

isum = 0

This prompts the user for input

num = int(input("Num: "))

The loop is repeated until the user enters a negative number

while num >= 0:

This calculates the sum of the list

   isum+=num

This appends the input to the list

   nums.append(num)

This prompts the user for another input

   num = int(input("Num: "))

   

This prints the sum of the list

print("Sum: ",isum)

This prints the average of the list

print("Average: ",isum/len(nums))

This prints the minimum of the list

print("Minimum: ",min(nums))

This prints the maximum of the list

print("Maximum: ",max(nums))

The function below takes one parameter: an integer (begin). Complete the function so that it prints every other number starting at begin down to and including 0, each on a separate line. There are two recommended approaches for this: (1) use a for loop over a range statement with a negative step value, or (2) use a while loop, printing and decrementing the value each time.

1 - def countdown_trigger (begin):
2 i = begin
3 while i < 0:
4 print(i)
5 i -= 1 Restore original file

Answers

Answer:

Follows are code to the given question:

def countdown_trigger(begin):#defining a method countdown_trigger that accepts a parameter

   i = begin#defining variable that holds parameter value

   while i >= 0:#defining while loop that check i value greater than equal to0

       print(i)#print i value

       i -= 2  # decreasing i value by 2  

print(countdown_trigger(2))#calling method

Output:

2

0

None

Explanation:

In this code, a method "countdown_trigger" is declared, that accepts "begin" variable value in its parameters, and inside the method "i" declared, that holds parameters values.

By using a while loop, that checks "i" value which is greater than equal to 0, and prints "value" by decreasing a value by 2.

To have a reason or purpose to do something

a
Motivate
b
Identity
c
Deceive
d
Anonymous

Answers

The answer is A. Motivate

Answer:

A

Explanation:

what is the determinant of the identity matrix I?​

Answers

Answer:

Explanation:

The ith column of an identity matrix is the unit vector ei (the vector whose ith entry is 1 and 0 elsewhere) It follows that the determinant of the identity matrix is 1, and the trace is n. When the identity matrix is the product of two square matrices, the two matrices are said to be the inverse of each other.

the importance of optimizing a code

Answers

Answer:

Definition and Properties. Code optimization is any method of code modification to improve code quality and efficiency. A program may be optimized so that it becomes a smaller size, consumes less memory, executes more rapidly, or performs fewer input/output operations.

How should you present yourself online?

a
Don't think before you share or like something
b
Argue with other people online
c
Think before you post
d
Tag people in photos they may not like

hurry no scammers

Answers

C maybe ......,,,,.....

Answer: C) Think before you post.

Explanation:

There's a very good chance that whatever you post online will remain there indefinitely. So it's best to think about what would happen if you were to post a certain message on a public place. Keep in mind that you should also safeguard against your privacy as well.

Can someone please help me I will mark u brilliant

Answers

Answer: “Frame rate (expressed in frames per second or FPS) is the frequency (rate) at which consecutive images called frames appear on a display. The term applies equally to film and video cameras, computer graphics, and motion capture systems. Frame rate may also be called the frame frequency, and be expressed in hertz” this is what I searched up and maybe you can see what’s similar

Explanation: I think it’s yellow

Answer: The answer is the first box, the rate at which frames in an animation are shown, typically measured in frames per second.

pls explain the meaning of the word"INTERNET"​

Answers

electronic communications network
: an electronic communications network that connects computer networks and organizational computer facilities around the world —used with the except when being used attributively doing research on the Internetan Internet search

Answer:

i would say its a stream of network in which many people use

Explanation:

For this lab you will write a class to create a user-defined type called Shapes to represent different shapes, their perimeters and their areas. The class should have three fields: shape, which is of type string, and perimeter and area of type double. The program will have to be able to calculate perimeters and areas for circles, triangles, squares and rectangles, which are the known shapes.
2.1 Constructors
Write these constructors:
1. Default constructor that sets the shape to "unknown" and the perimeter and area to 0
2. Constructor with one parameter, shape, that sets the shape, other fields are 0
2.2 Accessors & Mutators
Write the following member methods:
1. setShape()
Modifies the shape field
2. getShape()
Returns the shape field
3. getPerimeter()
Returns the perimeter field
4. getArea()
Returns the area field
Arithmetic Methods in Interface
Write the following member methods to perform arithmetic:
1. setPerimeter(Scanner scnr)
Depending on the shape, prompts the user for appropriate variables (ie width & height for a square, radius for a circle, etc.) and calculates the perimeter of the appropriate shape. The perimeter field should be updates with the new value. If the shape is unknown, then print to the screen that the user must first define a shape before a perimeter can be calculated and set the perimeter to 0.
2. setArea(Scanner scnr)
Depending on the shape, prompts the user for appropriate variables (ie width & height for a square, radius for a circle, etc.) and calculates the area of the appropriate shape. The area field should be updates with the new value. If the shape is unknown, then print to the screen that the user must first define a shape before an area can be calculated and set the area to 0.
2.3 Additional Methods
Create two additional methods of your choice. Be sure to clearly label both of these methods as your own.
2.4 Using another .java file called ShapesTest.java that tests that all of your methods work correctly

Answers

Answer:

========= Shape.java  ===========

//import the Scanner class

import java.util.Scanner;

public class Shape{

   //required fields

  private String shape;

   private double area;

   private double perimeter;

   //default constructor

  public Shape(){

       this.shape = "unknown";

       this.area = 0.0;

       this.perimeter = 0.0;

   }

   //constructor with one parameter

   public Shape(String shape){

       this.setShape(shape);

       this.area = 0.0;

       this.perimeter = 0.0;

   }

   //accessors and mutators

  public void setShape(String shape){

       this.shape = shape;

   }

  public String getShape(){

       return this.shape;

   }

   public double getPerimeter(){

       return this.perimeter;

   }

  public double getArea(){

       return this.area;

   }

  public void setPerimeter(Scanner scr){

       if(this.getShape().equals("circle")){

           System.out.println("Enter the radius of the circle");

           double radius = scr.nextDouble();

           this.perimeter = 2 * 3.142 * radius;

       }

       else if(this.getShape().equals("rectangle")){

           System.out.println("Enter the width");

           double width = scr.nextDouble();

           System.out.println("Enter the height");

           double height = scr.nextDouble();

           this.perimeter = 2 * (width + height);

       }

       else if(this.getShape().equals("square")){

           System.out.println("Enter the height or width");

           double height = scr.nextDouble();

           this.perimeter = 4 * height;

       }

       else if(this.getShape().equals("unknown")){

           System.out.println("You must define a shape first before calculating perimeter");

           this.perimeter = 0.0;

       }

       else {

           System.out.println("You must define a shape first before calculating perimeter");

           this.perimeter = 0.0;

       }

   }

   public void setArea(Scanner scr){

       if(this.getShape().equals("circle")){

           System.out.println("Enter the radius of the circle");

           double radius = scr.nextDouble();

           this.area = 3.142 * radius * radius;

       }

       else if(this.getShape().equals("rectangle")){

           System.out.println("Enter the width");

           double width = scr.nextDouble();

           System.out.println("Enter the height");

           double height = scr.nextDouble();

           this.area = width * height;

       }

       else if(this.getShape().equals("square")){

           System.out.println("Enter the height or width");

           double height = scr.nextDouble();

           this.area = height * height;

       }

       else if(this.getShape().equals("unknown")){

           System.out.println("You must define a shape first before calculating area");

           this.area = 0.0;

       }

       else {

           System.out.println("You must define a shape first before calculating area");

           this.area = 0.0;

       }

   }

   //Own methods

   //1. Method to show the properties of a shape

   public void showProperties(){

       System.out.println();

       System.out.println("The properties of the shape are");

       System.out.println("Shape : " + this.getShape());

       System.out.println("Perimeter : " + this.getPerimeter());

       System.out.println("Area : " + this.getArea());

   

   }

   //2. Method to find and show the difference between the area and perimeter of a shape

   public void getDifference(){

       double diff = this.getArea() - this.getPerimeter();

       System.out.println();

       System.out.println("The difference is " + diff);

   }

}

========= ShapeTest.java  ===========

import java.util.Scanner;

public class ShapeTest {

   public static void main(String [] args){

       Scanner scanner = new Scanner(System.in);

       // create an unknown shape

       Shape shape_unknown = new Shape();

       //get the shape

       System.out.println("The shape is " + shape_unknown.getShape());

       //set the area

       shape_unknown.setArea(scanner);

       //get the area

       System.out.println("The area is " + shape_unknown.getArea());

       //set the perimeter

       shape_unknown.setPerimeter(scanner);

       //get the perimeter

       System.out.println("The perimeter is " + shape_unknown.getPerimeter());

       // create another shape - circle

       Shape shape_circle = new Shape("circle");

       //set the area

       shape_circle.setArea(scanner);

       //get the area

       System.out.println("The area is " + shape_circle.getArea());

       //set the perimeter

       shape_circle.setPerimeter(scanner);

       //get the area

       System.out.println("The perimeter is " + shape_circle.getArea());

       //get the properties

       shape_circle.showProperties();

       //get the difference between area and perimeter

       shape_circle.getDifference();

   }

}

Sample output:

The shape is unknown

You must define a shape first before calculating area

The area is 0.0

You must define a shape first before calculating perimeter

The perimeter is 0.0

Enter the radius of the circle

>> 12

The area is 452.448

Enter the radius of the circle

>> 12

The perimeter is 452.448

The properties of the shape are

Shape : circle

Perimeter : 75.408

Area : 452.448

The difference is 377.03999999999996

Explanation:

The code above is written in Java. It contains comments explaining important parts of the code. Please go through the code for more explanations. For better formatting, the sample output together with the code files have also been attached to this response.

Instructions: Use the tables below to answer the questions that follow:
Total Points
12
Table 1.1
Age
16
1234
1356
1254
1334
Name
Charles
Junior
Carla
Josie
STUDENTS
Class
Gender
3B
Female
35
Male
35
Female
3B
Female
20
21
Payment
$28.00
$32.00
$44.00
$50.00
18
1. State the data type that would be most suitable to use for: (6pts)
a. Class
b. Age
2. How
How many records are in the table?
3. Identify 2 examples of field names in the table above. (4pts)
c. Payment
(2pts)
a.
b.​

Answers

Answer:

1.B

sorry po yan lang alam ko eh sorrt

Explanation:

brainelst po

What is a computer system model and explain?

Answers

Answer:

Systems modeling or system modeling is the interdisciplinary study of the use of models to conceptualize and construct systems in business and IT development. A common type of systems modeling is function modeling, with specific techniques such as the Functional Flow Block Diagram and IDEF0.

Explanation:

have a great day

A system performance assessment that is being utilized to forecast environmental circumstances, is a system model. A further explanation is provided below.

Manufacturers or consumers build including using theoretical model scheduling for construction project system stability, project capability, bottlenecks analysis as well as control systems configuration. This lecture is about the development of system models with an existing process or operational model.

Learn more about the Computer system model here:

https://brainly.com/question/20292974

what should the timing of transition slides be per minute? maintain the flow of the presentation to ______ slides per minute.

Answers

Answer:

1-2

Explanation:

It depends on the amount of information that you have on each slide. You want to make sure you're not going too fast but also make sure you arent taking up to much time. Be sure to speak clearly it will make the presentation better by looking clean and time organized. hope this helps :)

Which of the following applications is most likely to benefit from the use of crowdsourcing?
a. An application that allows users to purchase tickets for a local museum
b. An application that allows users to convert measurement units (e.g., inches to centimeters, ounces to liters)
c. An application that allows users to view descriptions and photographs of local landmarks
d. An application that allows users to compress the pictures on their devices to optimize storage space

Answers

Answer:

C

Explanation:

Various companies crowdsource programs in order to have image libraries available to do certain tasks, one of those could be to see the landmark over time from different photos.

IPSec or internet Protocol Security is an extension of the Internet Protocol. What does IPSec use to provide network security?

Answers

Answer:

In computing, Internet Protocol Security ( IPSec ) is a secure network protocol suite that authenticates and encrypts the packets of data to provide secure encrypted communication between two computers over on internet protocol network. It is used in virtual private networks ( VPNs ).

State three reasons why users attach speakers to their computer​

Answers

Answer:

For listening sake

To listen to information from the computer

They receive audio input from the computer's sound card and produce audio output in the form of sound waves.

SimpleScalar is an architectural simulator which enables a study of how different pro-cessor and memory system parameters affect performance and energy efficiency.

a. True
b. False

Answers

Answer:

a. True

Explanation:

SimpleScalar refers to a computer architectural simulating software application or program which was designed and developed by Todd Austin at the University of Wisconsin, Madison, United States of America. It is an open source simulator written with "C" programming language and it's used typically for modelling virtual computer systems having a central processing unit (CPU), memory system parameters (hierarchy), and cache.

The main purpose of SimpleScalar is to avail developers or manufacturers the ability to compare two computers based on their capacities (specifications) without physically building the two computers i.e using a simulation to show or illustrate that computer B is better than computer A, without necessarily having to physically build either of the two computers.

Hence, it is an architectural simulator which makes it possible to study how different central processing units (CPUs), memory hierarchy or system parameters and cache affect the performance and energy efficiency of a computer system.


What sort of query is (strbucks]?


Answers

Starbucks as understood

Design 3 classes: Computer - Superclass
Laptop - Subclass
Desktop - Subclass

You will design these classes to optimize the superclass/subclass relationship by creating instance variables and getter/setter methods.
Include the following instance variables:
int screenSize -
Inches of monitor space
int memory - GB of ram
double batteryLife - Hours of battery life
boolean monitor - Whether or not a monitor is included

Each class should have at least one variable in it.
Once completed, the Tester class should execute without error.

Answers

Answer:

Explanation:

The following code is written in Java. It creates the three classes mentioned and a Tester class that contains the main method. The Computer class contains the memory variable since both laptops and Desktops need memory. The screen size variable is placed separately in the Laptop and Desktop class since desktops may or may not have a monitor so this variable cannot be placed in the Computer class. The batteryLife variable is only in the Laptop class because Desktops do not have batteries. Finally, the monitor variable is only placed in the Desktop class since Laptop's come with built-in monitors. The tester class seen in the picture below tests the creation of both of these objects and it executes without any error.

class Computer {

   int memory;

   public int getMemory() {

       return memory;

   }

   public void setMemory(int memory) {

       this.memory = memory;

   }

}

class Laptop extends Computer {

   int screenSize;

   double batteryLife;

   public int getScreenSize() {

       return screenSize;

   }

   public void setScreenSize(int screenSize) {

       this.screenSize = screenSize;

   }

   public double getBatteryLife() {

       return batteryLife;

   }

   public void setBatteryLife(double batteryLife) {

       this.batteryLife = batteryLife;

   }

}

class Desktop extends Computer {

   boolean monitor;

   int screenSize;

   public boolean isMonitor() {

       return monitor;

   }

   public void setMonitor(boolean monitor) {

       this.monitor = monitor;

   }

   public int getScreenSize() {

       return screenSize;

   }

   public void setScreenSize(int screenSize) {

       this.screenSize = screenSize;

   }

}

class Tester {

   public static void main(String[] args) {

       Laptop computer1 = new Laptop();

       Desktop computer2 = new Desktop();

   }

}

In which category would Jamal most likely find an appropriate template for his report?

Designs
Diagrams
Education
Personal

Answers

Answer:

Education

Explanation:

which service is a major commercial cloud platform?
a. Microsoft SQL Services
b. SAP Cloud Services
c. Amazon Web Services
d. Oracle Enterprise Services

Answers

Answer: Amazon Web Service

Explanation:

The service that's a major commercial cloud platform is the Amazon Web Service.

Amazon Web Services offers global cloud based products which include databases, storage, networking, IoT, developer tools, analytics, mobile, develo management tools, security applications etc.

The services are of immense benefit to organizations as they help them in achieving their goals as it helps in lowering IT costs, increase speed, enhance efficiency and revenue.

Other Questions
A new car battery is sold with a two-year warranty whereby the owner gets the battery replaced free of cost if it breaks down during the warranty period. Suppose an auto store makes a net profit of $20 on batteries that stay trouble-free during the warranty period; it makes a net loss of $10 on batteries that break down. The life of batteries is known to be normally distributed with a mean and a standard deviation of 40 and 16 months, respectively.Required:a. What is the probability that a battery will break down during the warranty period?b. What is the expected profit of the auto store on a battery?c. What is the expected monthly profit on batteries if the auto store sells an average of 500 batteries a month? have to write a report on cold war Please help me please please Summative Task ResearchTopicChallenges faced by acadians after deportationWho wasinvolved?Whathappened?Where didthis happen?When did this happen?how did this happen?significance to Canadian history please help asap for 20 pointsanswer with bot link will be reported Three students, Brayden, Adrian, and Aubrey, line up one behind the other. How many different ways can they stand in line? Giving brainliest show work pls ! Ty Calculate the weight(W) of a 40 Kg bowling ball? W = m(Kg) x g (9.8 m/s2) the sentence "neither... offensive" (sentence 5) does which of the following What is the surface area of the tent? Two methods can be used to produce expansion anchors. Method A costs $80,000 initially and will have a $15,000 salvage value after 3 years. The op-erating cost with this method will be $30,000 in year 1, increasing by $4000 each year. Method B will have a first cost of $120,000, an operating cost of $8000 in year 1, increasing by $6500 each year, and a $40,000 salvage value after its 3-year life. At an interest rate of 12% per year, which method should be used on the basis of a present worth analysis Which qualifications are typical for someone working as an fbi agent? What is the stonewall alliance of Chico? Write 2-3 sentences can you help me please After what battle won did the French join the American Revolution? Please anwser this question. y= x - 5y=-7x + 11Cherry Why is knowing where volcanoes and earthquakes occur important?Please help!!!!! How did the post world war 2 change life and economics in the United States What speed would a plane average on a tripof 4000 miles that took 6 hours?(A) 150.0 miles per hour(B) 666.6 miles per hour(C) 366.6 miles per hour(D) 1500.0 miles per hour Which of the following is/are correct in the case of free fall motion?(I) Free fall is a linear motion.(II) Free fall is a uniformly accelerated motion.(III) Free fall is a motion under gravity alone.A) I and IIB) I onlyC) II onlyD) I, II, and III