Implement a class Rectangle. Provide a constructor to construct a rectangle with a given width and height, member functions get_perimeter and get_area that compute the perimeter and area, and a member function void resize(double factor) that resizes the rectangle by multiplying the width and height by the given factor. (Page EX9-3).

Answers

Answer 1
Answer:

//class declaration

public class Rectangle{

   

   //declare the instance variables - width and height

   double width;

   double height;

   

   

   //the constructor

  public Rectangle(double width, double height){

       

       //initialize the width of the rectangle

       this.width = width;

       

       //initialize the height of the rectangle

      this.height = height;

       

   }

   

   

   //method get_perimeter to compute the perimeter of the rectangle

   public double get_perimeter(){

       

       //compute the perimeter

       //by using the formula 2(width + height)

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

       

       //return the perimeter

       return perimeter;

   }

   

   //method get_area to compute the area of the rectangle

   public double get_area(){

       

       //compute the area

       //by multiplying the width and height of the rectangle

       double area = this.width * this.height;

       

       //return the area

      return area;

   }

   

   

   //method resize to resize the rectangle

   public void resize(double factor){

       

       //resize the width of the rectangle

       //by multiplying the width by the factor

       this.width = this.width * factor;

       

       //resize the height of the rectangle

       //by multiplying the height by the factor

      this.height = this.height * factor;

     

   }

   

}  //end of class declaration

Explanation:

The code above has been written in Java. In contains comments explaining every part of the program.


Related Questions

Which of the following has the greatest impact on telecommunications design?
availability of resources used in manufacturing
consumer functionality demands
O cost of materials used in manufacturing
O currently trending fashion designs

Answers

Answer:

I don't know

Explanation:

Sorry if i'm not helpful. I just need to complete a challenge

If AX contains hex information 2111 and BX contains hex information 4333, what is the content in BX in hex format after performing ASM instruction ADD BX, AX

Answers

Answer:

BX will hold 6444 in hex format.

Explanation:

From the given information:

We need to understand that AX is 64-bit hex number.

When performing ASM instruction (Assembly language instruction),

The addition of 2111 + 4333 = 6444 will be in BX.

This is because ADD, BX, AX will add bx and ax; and the final outcome will be stored in BX.

BX will hold 6444 in hex format.

Write a 3-4 page paper (500-800 words) about your project that explains your project, the type of conditioning you used, and the methods and procedures used to execute your project. You should explain the process of shaping the behavior and utilize any or all appropriate vocabulary. Finally, include a discussion of the results and an analysis of recommendations for improvement or future changes.

Answers

Answer:

Following are the responses to the given question:

Explanation:

I have decided to take up my project as a change in my behavior of not working out and exercising on daily basis. To execute this project, I decided to use ‘Operant conditioning’ to be able to complete it successfully. The reason for choosing this as my project is to be able to change my unhealthy behavior of not exercising daily, which is now having an impact on my weight as well as on my mind.

Operant Conditioning is also known as instrumental conditioning was used by the behaviorist B.F Skinner. Through operant conditioning, Skinner explained how we adapt to several learned behaviors in our everyday life. Its idea of such conditioning would be that the acts that accompany reinforcement will most likely occur in the future.

They may call it a punishment for actions and retribution. A relationship is formed between that action as well as its consequences. I began my project with an order of a watch to keep track of my daily workout and even downloaded a phone-based software to track my calorie each day. The concept behind it was to understand my everyday work and my calorie consumption because these variables inspire me to choose more to achieve my aim to practice and maintain my weight safely.

So, to find any way to miss it I did the routine calendar. We also made a small and comprehensive strategy for the first few weeks such as early awakening and 10 minutes getting warmed up. I concentrated on the operating conditioning function and reaction. I've been honored by enjoying my important topics for one hour every week that I finished my practice according to my planned routine. I wanted and award myself quarterly rewards in addition to daily rewards. When the goal of a daily exercise is also achieved, I decided to go out to my favorite coffee just at end of November.

It's not a matter of giving one of my favorite stuff to my cousins to affirm my everyday life except for one year within a week (except when I'm unwell). The fear of missing one of my items that I'd always agreed only at beginning of the week prevented me from achieving my target of exercise every day and made me very content to go to my favorite coffee shop. It made it more motivating for someone like me to proceed with the positive and negative reinforcement of doing my everyday exercise routine. I also get used to my fresh and safe routine every day, but also the results are impressive.

Even though I don't feel about rewarding myself with something that I like, I am very much happy because of the positive result which I have a fit body and maintain a healthy lifestyle. Those who removed my daily positive and negative exercise reinforcements, as well as the monthly incentive, could not be required in the future. Moreover, I can work on a closer look for 6 abs.

To launch the mail merge help dialog box, what option should you select using the Microsoft word office assistant?​

Answers

Answer:

Complete setup.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

A Mail Merge is a Microsoft Word feature that avails end users the ability to import data from other Microsoft applications such as Microsoft Access and Excel. Thus, an end user can use Mail Merge to create multiple documents (personalized letters and e-mails) for each entry in the list at once and send to all individuals in a database query or table.

Hence, Mail Merge is a Microsoft Word feature that avails users the ability to insert fields from a Microsoft Access database into multiple copies of a Word document.

Some of the options available in the Write & Insert Fields group of Mail Merge are;

I. Highlight Merge Fields.

II. Address Block.

III. Greeting Line.

Generally, when a user wants to launch the Mail Merge help dialog box, the option he or she should select using the Microsoft word office assistant is complete setup.

Additionally, the sequential steps of what occurs during the mail merge process are;

1. You should create the main document

2. Next, you connect to a data source

3. You should highlight or specify which records to include in the mail.

4. You should insert merge fields.

5. Lastly, preview, print, or email the document.

What will the declaration below do to its target?

animation-direction: reverse;
The animation steps will play backward.
The animation steps will play forward, then backward.
The animation steps will play forward.
The animation steps will play backward, then forward.

Answers

The animation steps will play forward then backward

write a program to enter 30 integer numbers into an array and display​

Answers

Answer:

i764

Explanation:

Answer:

Explanation:

Python:

numberlist = []

for i in range(0, 29):

   a = input("Enter a number: ")

   numberlist[i] = a

print(*meh, sep = "\n")

Which of the following is NOT a computer hardware?
A) monitor
B) scanner
C) modem
D) Windows 10

Answers

Answer is d hope this helps

Write a recursive function that has an argument that is an array of characters and two arguments that are bounds on array indexes. The function should reverse the order of those entries in the array whose indexes are between the two bounds. For example, if the array is a[0]

Answers

Answer:

The function is as follows:

void revArray(char arr[], unsigned int low, unsigned int high)  {  

      if (low >= high){

        return;  }

  swap(arr[low], arr[high]);  

  revArray(arr, low + 1, high - 1);  }

Explanation:

This declares the function. It receives a char array and the lower and upper bounds to be reversed

void revArray(char arr[], unsigned int low, unsigned int high)  {  

This is the base case of the recursion (lower bound greater than or equal to the upper bound).

      if (low >= high){

        return;  }

This swaps alternate array elements

  swap(arr[low], arr[high]);  

This calls the function for another swap operation

  revArray(arr, low + 1, high - 1);  }

Linda wants to change the color of the SmartArt that she has used in her spreadsheet. To do so, she clicks on the shape in the SmartArt graphic. She then clicks on the arrow next to Shape Fill under Drawing Tools, on the Format tab, in the Shape Styles group. Linda then selects an option from the menu that appears, and under the Colors Dialog box and Standard, she chooses the color she wants the SmartArt to be and clicks OK. What can the option that she selected from the menu under Shape Fill be

Answers

Answer: Theme colors

Explanation:

Based on the directions, Linda most probably went to the "Theme colors" option as shown in the attachment below. Theme colors enables one to change the color of their smart shape.

It is located in the "Format tab" which is under "Drawing tools" in the more recent Excel versions. Under the format tab it is located in the Shape Styles group as shown below.

Kyra needs help deciding which colors she should use on her web page. What can she use to help her decide? (5 points)
.Color selection
.Color theory
.Proofreading
.Storyboarding

Answers

Color theory !!! Step by step explanation: no <3 just take the answer

Correct Answer: Color selection

hello! can someone write a c++ program for this problem

Problema 2018.3.2 - Cheated dice
Costica is on vacation and his parents sent him to the country. There he gets terribly bored and looking through his grandfather's closet, he came across a bag full of dice. Having no one to play dice with, but it seemed to him that some of the dice were heavier than the others, Costica chose a dice and started to test it by throwing it with him and noting how many times each face fell. He then tries to figure out whether the dice are rolled or not, considering that the difference between the maximum number of appearances of one face and the minimum number of occurrences (of any other face) should not exceed 10% of the total number of throws.
Requirement
Given a number N of dice rolls and then N natural numbers in the range [1: 6] representing the numbers obtained on the rolls, determine whether the dice is tricked according to the above condition.
Input data
From the input (stdin stream) on the first line reads the natural number N, representing the number of rolls. On the following N lines there is a natural number in the range [1: 6] representing the numbers obtained on throws.
Output data
At the output (stdout stream) a single number will be displayed, 0 or 1, 0 if the dice are normal, and 1 if it is cheated.
ATTENTION to the requirement of the problem: the results must be displayed EXACTLY in the way indicated! In other words, nothing will be displayed on the standard output stream in addition to the problem requirement; as a result of the automatic evaluation, any additional character displayed, or a display different from the one indicated, will lead to an erroneous result and therefore to the qualification "Rejected".
Restrictions and clarifications
1. 10 ≤ N ≤ 100
2. Caution: Depending on the programming language chosen, the file containing the code must have one of the extensions .c, .cpp, .java, or .m. The web editor will not automatically add these extensions and their absence makes it impossible to compile the program!
3. Attention: The source file must be named by the candidate as: . where name is the last name of the candidate and the extension (ext) is the one chosen according to the previous point. Beware of Java language restrictions on class name and file name!
Input data

10
6
6
6
6
6
6
6
6
6
6
Output data
1

Roll the dice 10 times, all 10 rolls produce the number 6. Because the difference between the maximum number of rolls (10) and the minimum number of rolls (0) is strictly greater than 10% of the total number of rolls (10% of 10 is 1), we conclude that the dice are oiled.

Input data
10
1
4
2
5
4
6
2
1
3
3
Output data
0

Throw the dice 10 times and get: 1 twice, 2 twice, 3 twice, 4 twice, 5 and 6 at a time. Because the difference between the maximum number of appearances (two) and the minimum number of occurrences (one) is less than or equal to 10% of the total number of throws (10% of 10 is 1), we conclude that the dice are not deceived.

Answers

Answer:

f0ll0w me on insta gram Id:Anshi threddy_06 (no gap between I and t)

g Consider a disk queue with requests for I/O to blocks on cylinders 95, 120, 41, 122, 15, 142, 65, 167. The Shortest Seek Time First (SSTF) scheduling algorithm is used. The head is initially at cylinder number 100. The cylinders are numbered from 0 (center of disk) to 199 (edge of disk). a) List the requests in the order in which they will be serviced. b) What is the total head movement (in number of cylinders) incurred while servicing these requests

Answers

Answer:

follows are the solution to the given question:

Explanation:

Please find the image file for the SSTF scheduling algorithm.

Following are the requested order:

[tex]Request \ \ order :\\\\95\\120\\122\\142\\167\\65\\ 41\\15[/tex]

Calculating the Total Head Movement:

[tex]= (100-95) + (120-95) + (122-120) + (142-122) + (167-142) + (167-65) + (65-41) + (41-15)\\\\= 5 + 25 + 2 + 20 + 25 + 102 + 24 + 26\\\\= 229[/tex]

Select the correct term to complete the sentence.
The
file format is used for video files.

A. .pptx

B. .mp3

C. .jpeg

D. .mp4

Answers

Answer: D. mp4

its mp4 because its always on video files

Given a member function named set_age() with a parameter named age in a class named Employee, what code would you use within the function to set the value of the corresponding data member if the data member has the same name as the parameter

Answers

Answer:

Explanation:

This would be considered a setter method. In most languages the parameter of the setter method is the same as the variable that we are passing the value to. Therefore, within the function you need to call the instance variable and make it equal to the parameter being passed. It seems that from the function name this is being written in python. Therefore, the following python code will show you an example of the Employee class and the set_age() method.

class Employee:

   age = 0

   

   def __init__(self):

       pass

   

   def set_age(self, age):

       self.age = age

As you can see in the above code the instance age variable is targeted using the self keyword in Python and is passed the parameter age to the instance variable.        

tell me the most scariest website you know and i'll give you brainlest

Answers

Answer:

it's not a website but on insta there's an account that freezes people's phone when you click on their story.

Explanation:

Why computer is known as versatile and diligent device? Explain​

Answers

They work at a constant speed to do the task. Unlike a human, they will not slow down or get bored or start making mistakes that they were not doing earlier. So once they are programmed correctly to do a task, they will do it diligently.

They are versatile because they can be used for all sorts of tasks. They can also do many of the same tasks in different ways. They are diligent because they will do a task thoroughly until it is finished.

By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway) connected to that network. (true or false)

Answers

Answer:

t

r

u

e

n      .....................................................                                    

4. Write a program to calculate square root and
cube root of an entered number .​

Answers

Answer:

DECLARE SUB SQUARE (N)

CLS

INPUT “ENTER ANY NUMBER”; N

CALL SQUARE(N)

END

SUB SQUARE (N)

S = N ^ 2

PRINT “SQUARE OF NUMBER “; S

END SUB

Write a program to implement problem statement below; provide the menu for input N and number of experiment M to calculate average time on M runs. randomly generated list. State your estimate on the BigO number of your algorithm/program logic. (we discussed in the class) Measure the performance of your program by given different N with randomly generated list with multiple experiment of Ns against time to draw the BigO graph (using excel) we discussed during the lecture.

Answers

Answer:

Explanation:

#include<iostream>

#include<ctime>

#include<bits/stdc++.h>

using namespace std;

double calculate(double arr[], int l)

{

double avg=0.0;

int x;

for(x=0;x<l;x++)

{

avg+=arr[x];

}

avg/=l;

return avg;

}

int biggest(int arr[], int n)

{

int x,idx,big=-1;

for(x=0;x<n;x++)

{

if(arr[x]>big)

{

big=arr[x];

idx=x;

}

}

return idx;

}

int main()

{

vector<pair<int,double> >result;

cout<<"Enter 1 for iteration\nEnter 2 for exit\n";

int choice;

cin>>choice;

while(choice!=2)

{

int n,m;

cout<<"Enter N"<<endl;

cin>>n;

cout<<"Enter M"<<endl;

cin>>m;

int c=m;

double running_time[c];

while(c>0)

{

int arr[n];

int x;

for(x=0;x<n;x++)

{

arr[x] = rand();

}

clock_t start = clock();

int pos = biggest(arr,n);

clock_t t_end = clock();

c--;

running_time[c] = 1000.0*(t_end-start)/CLOCKS_PER_SEC;

}

double avg_running_time = calculate(running_time,m);

result.push_back(make_pair(n,avg_running_time));

cout<<"Enter 1 for iteration\nEnter 2 for exit\n";

cin>>choice;

}

for(int x=0;x<result.size();x++)

{

cout<<result[x].first<<" "<<result[x].second<<endl;

}

}

How have technology and social media changed reading?
O A. Physical books can only be read on the web.
B. Now reading is a conversation of give and take.
O C. People no longer have to read anything at all.
D. Reading often takes much longer to undergo.

Answers

Answer:

B?

Explanation:

I'm super sorry if I get this wrong for you but after thinking so much I probably think it would be B

Answer:

the guy above is right it is B

Explanation:

because 2+2=4

What does the top-level domain in a URL indicate?
A. the organization or company that owns the website
B. the organization or company that operates the website
C. the protocol used to access the website D. the type of website the URL points to

Answers

Answer:

b i think

Explanation:

A top-level domain (TLD) is the last segment of the domain name. The TLD is the letters immediately following the final dot in an Internet address. A TLD identifies something about the website associated with it, such as its purpose, the organization that owns it or the geographical area where it originates.

Answer:

The answer is D. The type of website the URL points to.

Explanation:

I got it right on the Edmentum test.

Which of the following is true? a. There are RFCs that describe challenge-response authentication techniques to use with email. b. Filtering for spam sometimes produces a false positive, in which legitimate email is identified as spam. c. Spam relies heavily on the absence of email authentication. d. All of the above.

Answers

The option that is true is option b. Filtering for spam sometimes produces a false positive, in which legitimate email is identified as spam.

How is spam filtration carried out?

The processing of email to organize it in accordance with predetermined criteria is known as email filtering. The word can allude to the use of human intelligence, although it most frequently describes how messages are processed automatically at SMTP servers, sometimes using anti-spam tactics.

Therefore, Email filtering operates as previously stated by scanning incoming messages for red flags that indicate spam or phishing content and then automatically transferring such messages to a different folder. Spam filters evaluate an incoming email using a variety of criteria.

Learn more about Filtering for spam from

https://brainly.com/question/13058726
#SPJ1

how you use ict today and how will you use it tomorrow

Answers

Answer:

you use it in water today

Explanation:

tomorrow you'll use it in soda

What is the function of the NOS? Select all that apply.

•network management
•connects network nodes
•network security
•provides MACs
•gives access to privileges
•data protection

Answers

Answer:

.network management

Explanation:

pls need brainliest

Answer:

gives access privileges

network management

network security

data protection

Explanation:

Question #4
Math Formula
What will you see on the next line?
>>>int(3.9)

Answers

Answer:

3

Explanation:

The correct answer is 3. The int() function truncates the decimal part.

-Edge 2022

Write a function that displays the character that appears most frequently in the string. If several characters have the same highest frequency, displays the first character with that frequency. Note that you must use dictionary to count the frequency of each letter in the input string. NO credit will be given without using dictionary in your program

Answers

Answer:

The function is as follows:

def getMode(str):

occurrence = [0] * 256

dict = {}

for i in str:

 occurrence[ord(i)]+=1;

 dict[i] = occurrence[ord(i)]

 

highest = max(dict, key=dict.get)

print(highest)

Explanation:

This defines the function

def getMode(str):

This initializes the occurrence list to 0

occurrence = [0] * 256

This creates an empty dictionary

dict = {}

This iterates through the input string

for i in str:

This counts the occurrence of each string

 occurrence[ord(i)]+=1;

The string and its occurrence are then appended to the dictionary

 dict[i] = occurrence[ord(i)]

This gets the key with the highest value (i.e. the mode)

highest = max(dict, key=dict.get)

This prints the key

print(highest)

list and describe each of the activities of technology

Answers

Answer:

network has led to exposure of dirty things to young ones.

air transport has led to losing of lives

Write a method called lexLargest that takes a string object argument containing some text. Your method should return the lexicographical largest word in the String object (that is, the one that would appear latest in the dictionary).

Answers

Answer:

public static String lexLargest(String text){

       //split the text based on whitespace into individual strings

       //store in an array called words

       String[] words = text.split("\\s");

       

       //create and initialize a temporary variable

       int temp = 0;

       

       //loop through the words array and start comparing

       for(int i = 0; i < words.length; i++){

           

           //By ignoring case,

           //check if a word at the given index i,

           //is lexicographically greater than the one specified by

           //the temp variable.

          if(words[i].compareToIgnoreCase(words[temp]) > 0){

               

               //if it is, change the value of the temp variable to the index i

              temp = i;

           }    

       }

       

       //return the word given by the index specified in the temp

               // variable

       return words[temp];

    }

Sample Output:

If the text is "This is my name again", output will be This

If the text is "My test", output will be test

Explanation:

The code above has been written in Java. It contains comments explaining the code. Sample outputs have also been given.

However, it is worth to note the method that does the actual computation for the lexicographical arrangement. The method is compareToIgnoreCase().

This method, ignoring their cases, compares two strings.

It returns 0 if the first string and the second string are equal.

It returns a positive number if the first string is greater than the second string.

It returns a negative number if the first string is less than the second string.

Select the correct answer.
What is the advantage of using transparencies?
O A. They support better image quality than online presentations.
O B. They are helpful when creating non-linear presentations.
OC. They allow the presenter to jot down points on the slide.
OD. They are better suited to creating handouts.
Reset
Next

Answers

Answer:

They are better suited to creating handouts

In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" otherwise.

Answers

I am assuming that user_val is an inputted variable and a whole number (int)...

user_val = int(input("Enter a number: "))

if user_val < 0:

   print("negative")

else:

   print("non-negative")

Other Questions
The graph of a linear equation is shown. y N HNWO -7-6-5-4-3-2-11+1234 5 6 7 -27 -3 Place values in the table to show three ordered pairs that are each part of the solution set of the linear equation. 2 P. y 4 2 -6 -3 - 6 el punto (4, -3) esta sobre el lado terminal del angulo 0 en posicion normal. hallar el valor de las seis razones trigonometricas de ese angulo Helpppppppp plzzzz thank youu The price of an Android phoneincreased from $250 to $300. By whatpercentage was the price of thephone increased? Pick the answer below.F 20%H 40%G 30%J 50%FGHJ What is the typical duty of a firefighter? GEOMETRY/EASY 10 POINTSWHATS THE AREA OF THE SECTOR?GOD BLESS U Before there was psychological theory, Aristotle and Locke believed that knowledge is acquired from experience. This belief is most consistent with which approach?the behavioral approachthe psychoanalytic approachthe humanistic approachthe biological approachthe psychodynamic approach There's a 90 triangle. The other two angles are 30 and 60. The shortest line is nine the longest line is C. It's asking what sea is in simplest radical form What is a product imported to Mexico Whoever solves this right will get brainliest :3 what is 3 x 3 x 9 x 9 x 81 x 81 x 6561 x 6561 can i please have help with this im confused help!!!! what is the value of 3 in 24.635 ou discover that the complex decomposes in water. When 0.1000 g of the complex is dissolved in water with excess NaHg(SCN)4, all of the Co(II) is precipitated as CoHg(SCN)4 (s). After the precipitate is washed and dried, its mass is found to be 0.1102 g. How many grams of cobalt are contained in the original 0.1000 grams of the complex Write a program to implement problem statement below; provide the menu for input N and number of experiment M to calculate average time on M runs. randomly generated list. State your estimate on the BigO number of your algorithm/program logic. (we discussed in the class) Measure the performance of your program by given different N with randomly generated list with multiple experiment of Ns against time to draw the BigO graph (using excel) we discussed during the lecture. Which of these is an incorrect sequence of foods pathway through the digestive tract?A. Stomach, large intestine, duodenumB. Mouth, esophageal sphincter, pyloric sphincterC. Esophagus, jejunum, rectumD. Ascending colon, transverse colon, descending colon. Who was Elizabeth ? When did She Die ? Help! I am stuck and cant find this anywhere! question in picture... HELLO PLEASE HELP ME WITH THIS