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
AVprozaik [17]
2 years ago
8

Objects both in the real world and in object-oriented programming contain ____ and methods.

Computers and Technology
1 answer:
larisa86 [58]2 years ago
6 0

Objects both in the real world and in object-oriented programming contain <u>attributes</u> and methods.

<h3>What is an attribute?</h3>

In Computer technology, an attribute can be defined as a unique characteristic or quality which primarily describes an entity in a software program.

<h3>What is a method?</h3>

In Computer programming, a method can be defined as a block of executable code (sets of instruction) that are written and used by programmers to break down a given problem into small but manageable fragments (pieces).

This ultimately implies that, methods are typically written and used by programmers to break down any complex problem into simple and manageable fragments (pieces). Also, all modern programming languages comprises several methods that are predefined.

In this context, we can infer and logically deduce that all objects both in the real world and in object-oriented programming generally contain <u>attributes</u> and methods.

Read more on methods here: brainly.com/question/25619349

#SPJ4

You might be interested in
What is the most credible website or webpage you have ever visited? Why is it so credible? Describe some of the qualities that m
8_murik_8 [283]
— Look for Sites from Established Institutions.
— Look for Sites with Expertise
— Do not click on Commercial Sites
— Beware of Bias
— Check when it was last updated, so you get recent info.
— Check Links
— Avoid Anonymous Authors.
6 0
4 years ago
Read 2 more answers
g Write a program that asks for the weight of a package and the distance it is to be shipped. This information should be passed
DIA [1.3K]

Answer:

I am writing a C++ program:

#include <iostream>  //to use input output functions

#include<iomanip>  // to format the output

using namespace std;   // to identify objects like cin cout

void calculateCharge(double weight, double distance);   // function prototype

int main(){  //start of main() function body

  double w = 0.0, t = 0.0;  // w variable is for weight and t is for total

   unsigned int d = 0;   // d variable is to hold the value of distance

   calculateCharge(w, d); }  //calls calculateCharge method by passing weight and distance values to this method

void calculateCharge(double weight, double distance){  //method that takes weight and distance as parameters and compute the shipping charge

   double charge = 0.0;  //to store the value of shipping charges

   do {  // do while loop to handle multiple packages until a weight of 0 is entered

       cout << "Enter weight: " << endl;  //prompts user to enter weight

       cin >> weight;  //reads the input weight value

       if (weight == 0){  // if the value of weight is equal to 0

           break; }  // the loop breaks if value of weight is 0

       cout << "Enter distance: " << endl;  // if value of weight is not zero then the program precedes by prompting user to enter the value of distance

       cin >> distance;  //reads the input distance value

       cout << fixed << setprecision(2) << endl;  //set the precision to 2 means the sets the number of digits of an output to 2 decimal places

       if(weight <= 2)  //if the value of weight is less than or equals to 2

charge = (distance/500) * 3.10;  //compute the charge by this formula

else if(weight > 2 && weight <= 6)  //if weight is over 2 kg but not more than 6 kg

charge = (distance/500) * 4.20;  //charge is computed by multiplying value of distance to that of weight and if distance is greater than 500 then it is divided by 500 first

else if(weight > 6 && weight <= 10)  // if weight is over 6 kg but not more than 10 kg

charge = (distance/500) * 5.30;  //compute shipping charges by this formula

else  //if weight is over 10 kg

charge = (distance/500) * 6.40;   // compute shipping charge by multiplying value of distance to that of 6.40 weight value and if distance is greater than 500 then distance is divided by 500 first

cout << "Shipping charges: $" << charge << "\n";   //display the computed shipping charge

   } while (weight != 0);  //the loop continues to execute until weight 0 is entered

}              

Explanation:

The program is explained in the comments mentioned above. The program has a main() function that declares variable for weight, distance and total and then calls calculateCharge() method passing weight and dsitance in order to compute and return the shipping charge.

In calculateCharge() the user is prompted to enter the values for weight and distance. Then the based on the value of weight , the shipping charge is computed. Shipping charge is computed by multiplying the weight with distance. The distance is assumed to be 500 but if the distance entered by user exceeds 500 then the distance value is divided by 500 and then multiplied by the specified weight (according to if or else if conditions) in order to compute shipping charge. The program has a do while loop that keeps taking input from user until the user enters 0 as the value of weight.

The screenshot of the program and its output is attached.

7 0
4 years ago
Why do you think you are ready to handle the high school type of education and atmosphere? (in complete sentences)​
sertanlavr [38]

Answer:

I'm already in high school but at first, I was scared for my life literally. It wasn't what I expected it to be, though. Everyone was super nice to me and has been ever since I started. Turns out, high school is amazing.

Explanation:

5 0
3 years ago
Describe the system unit​
mestny [16]

Answer:

A system unit is the part of a computer that houses the primary devices that perform operations and produce results for complex calculations

6 0
3 years ago
Read 2 more answers
When comparison shopping, all of these hint at a good deal EXCEPT_____________________.
noname [10]

Answer:

lower-priced models offer more features

Explanation:

3 0
3 years ago
Other questions:
  • When creating an electronic slide presentation, Eliza should ensure that her presentation contains
    6·1 answer
  • Controls that are used to assess whether anything went wrong, such as unauthorized access attempts, are called ________ controls
    5·2 answers
  • Write the reverseO function recursively. This function takes a string and the length of the string as arguments and returns the
    15·2 answers
  • What happens when you get 3 warnings on this site?
    9·2 answers
  • Write two methods: encrypt and decrypt. encrypt should #take as input a string, and return an encrypted version #of it according
    6·1 answer
  • Which of the following is NOT an acceptable way to create a color?
    14·1 answer
  • According the SDLC phases, which among these activities see a substantial amount of automation initiatives?
    12·2 answers
  • It is a type of web page that allows you to share your ideas experiences and beliefs
    9·1 answer
  • Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
    8·1 answer
  • 15. You read a news article that's politically biased and not well organized. It's
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!