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
Nuetrik [128]
3 years ago
12

The purpose of a method's postcondition is to

Computers and Technology
1 answer:
anyanavicka [17]3 years ago
7 0
The answer that would best complete the given statement above would be option 5. The purpose of a method's postcondition is to describe the conditions that are true when the method completes. On the other hand, precondition describes the conditions that are true before the method is complete. Hope this helps.
You might be interested in
Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
Viktor [21]

Answer:

The program to this question can be given as:

Program:

import java.util.*;

//import package for user input  

class Main     //define class

{

public static void main(String a[])  

//define main function

{

int positive_number=0,negative_number=0,count=0,num; //define variable

double total=0,avg=0;  

//creating Scanner class object.

Scanner ob = new Scanner(System.in);

System.out.println("Enter an integer, when done input 0: "); //message

num= ob.nextInt();

//taking input from user

if (num==0)  //check number equal to 0  

{  

System.out.println("No numbers are entered except 0"); //message

System.exit(1);

}

else

{

while (num!= 0)  

{    

   if (num> 0)

   {

positive_number++; // Increase positives

}

else

{

negative_number++; // Increase negatives

}

total=total+num; // Accumulate total

count++;    // Increase the count

num=ob.nextInt();

}

// Calculate the average

avg=total/count;

// Display values

System.out.println("The positive number is:"+positive_number);

System.out.println("The negatives number is:"+negative_number);

System.out.println("total is:"+total);

System.out.println("average is:"+avg);

}

}

}

Output:

Enter an integer, when done input 0: 22

2

1

4

0

The positive number is:4

The negatives number is:0

total is:29.0

average is:7.25

Explanation:

In the above program firstly we import the package for user input then we define a class that is main in this class we define the main method in the main method we define variable. Then we create a scanner class object for user input. In the number variable, we take multiple inputs from the user and also check that the user does not insert 0 at the starting of the program. To check this we use the condition statement that is a number equal to 0 then it will terminate the program. In the else part we first declare the loop that checks that inserted number is positive and negative and in this, we calculate the total of the numbers and at the end of the loop, we calculate the average of the number and print all the values.

4 0
3 years ago
Read 2 more answers
Please help add header file
Elden [556K]

Answer:

jhgfycgxbhyjuufdxxcgbhjkml;,,,,,,,,,,,,,dfxcg,m .u9cgfbv nmkojihuygfc bvnjmkouhytfgvhbjfjfhngouuhjfcjbhbgfbjghbhjigjkijfbjfjigfijgfg

Explanation:

6 0
3 years ago
Summarize the features of several stand-alone operating systems ​
katen-ka-za [31]

Answer:

Stand-Alone Operating Systems •Microsoft Windows Mobile –Designed for smartphones and PDAs –Includes simplified versions of Windows programs –Supports handwriting recognition and voice recording –Supports synchronizing with corresponding programs on desktop computers

Explanation:

Stand-Alone Operating Systems •Microsoft Windows Mobile –Designed for smartphones and PDAs –Includes simplified versions of Windows programs –Supports handwriting recognition and voice recording –Supports synchronizing with corresponding programs on desktop computers

8 0
2 years ago
Which memory device is most appropriate for backing up a computer’s hard drive?
Luba_88 [7]
It depends on how much storage. I usually connect mine to another hard drive.
4 0
3 years ago
What is the effective address generated by the following instructions? Every instruction is
kaheart [24]
D. Mov ax, [bx+si] is your answer
5 0
2 years ago
Other questions:
  • What precaution can you take while using a social networking site to prevent a data breach?
    15·1 answer
  • Write a program that assigns two integer values from standard input to the variables int1 and int2, then prints "true" if they a
    10·1 answer
  • Using the bitwise AND operation, the result of 1 AND 0 is ___________. 10100100 ___________ 11010101 = 01110001. A common way to
    15·1 answer
  • In 1-2 paragraphs discuss the three main purposes of design and provide examples for each. Also explain how a design might serve
    15·1 answer
  • Suppose you want to use an Internet cafe to login to your personal account on a bank web site, but you suspect that the computer
    15·1 answer
  • PHP Create a for loop that initialize with the variable $i = 10 The loop outputs $i as long as $i is greater than 1 using for lo
    9·1 answer
  • Inputting a range of numbers comprising a batch and then inputting each serially numbered document is characteristic of the cont
    11·1 answer
  • Which of the following will increase the level of security for personal information on a mobile device if the device is lost or
    7·2 answers
  • When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be in a box, so if you buy 13
    10·1 answer
  • Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!