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
Svetllana [295]
2 years ago
12

Explain the four criteria for proving the correctness of a logical pretest loop construct of the form "while B do S end". And pr

ove the correctness of the following:
while B do S end
Engineering
1 answer:
evablogger [386]2 years ago
6 0

Answer:

Check the explanation

Explanation:

The loop invariant has to satisfy some amount of requirements to be of good use. Another complex factor as to why a loop is the question of loop termination. A loop that doesn’t terminate can’t invariably be correct, and in fact the computation in whatever form amounts to nothing. The total axiomatic description of a while construct will have to involve all of the following to be true, in which I is the loop invariant:

P => I

{I and B} S {I}

(I and (not B)) => Q

Then the loop terminates

You might be interested in
Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation.
Juliette [100K]

Answer:

THE CODE FOR THE PROGRAM IS GIVEN BELOW:

#include <iostream>

#include "ConvertTimeHeader.h"

using namespace std;

int main()

{

convertTime convert;

int hr, mn, sc = 0;

 

cout << "Please input hours in 12 hr notation: ";

cin >> hr;

cout << "Please input minutes: ";

cin >> mn;

cout << "Please input seconds: ";

cin >> sc;

 

convert.invalidHr(hr);

convert.invalidMin(mn);

convert.invalidSec(sc);

convert.printMilTime();

 

system("Pause");

 

return 0;  

 

}

#include <iostream>

#include "ConvertTimeHeader.h"

using namespace std;

int convertTime::invalidHr (int hour)

{

try{

 if (hour < 13 && hour > 0)

  {hour = hour + 12;

  return hour;}

 else{

 

  cin.clear();

  cin.ignore();

  cout << "Invalid input! Please input hour again in correct 12 hour format: ";

  cin >> hour;

  invalidHr(hour);

  throw 10;

 }

   

}

catch (int c) { cout << "Invalid hour input!";}

}

int convertTime::invalidMin (int min)

{

try{

 if (min < 60 && min > 0)

  {return min;}

 else{

 

  cin.clear();

  cin.ignore();

  cout << "Invalid input! Please input minutes again in correct 12 hour format: ";

  cin >> min;

  invalidMin(min);

  throw 20;

  return 0;

 }

   

}

catch (int e) { cout << "Invalid minute input!" << endl;}

}

int convertTime::invalidSec(int sec)

{

try{

 if (sec < 60 && sec > 0)

  {return sec;}

 else{

 

  cin.clear();

  cin.ignore();

  cout << "Invalid input! Please input seconds again in correct 12 hour format: ";

  cin >> sec;

  invalidSec(sec);

  throw 30;

  return 0;

 }

   

}

catch (int t) { cout << "Invalid second input!" << endl;}

}

void convertTime::printMilTime()

{

cout << "Your time converted: " << hour << ":" << min << ":" << sec;

}

Explanation:

4 0
3 years ago
An engineer is going to redesign an ejection seat for an airplane. The seat was designed for pilots weighing between 130 lb and
k0ka [10]

Answer:

A.) 0.3088

B.) 0.0017

C.) part A

Explanation:

A.)

z1= \frac{\left(150-137\right)}{27.7}=0.4693

z2=\frac{\left(201-137\right)}{27.7}=2.3105

P(0.4693

B.)

z1=\frac{150-137}{27.7/ \sqrt{39}} =2.9309\\z2=\frac{201-137}{27.7/ \sqrt{39}}=14.4289

\\P(2.9309

C.) Since the seat performance for an individual pilot is more important than 39 different pilots.

3 0
3 years ago
Read 2 more answers
State the number of terms for each of the following algebraic expression 2x+1
harina [27]

Answer:

Expressions are made up of terms.

A term is a product of factors.

Coefficient is the numerical factor in the term

Before moving to terms like monomials, binomials, and polynomials, like and unlike terms are discussed.

When terms have the same algebraic factors, they are like terms.

When terms have different algebraic factors, they are unlike terms.

Explanation:

Hi please follow me also if you can and thanks.

6 0
3 years ago
The role of civil and structural engineer is to produce buildings for
Alinara [238K]
So I’m thinking C because they both have a lot to do with design here is my evidence. Structural engineering is a component of civil engineering which focuses on the design and development of infrastructures such as bridges, skyscrapers, dams. Civil engineering is a professional engineering discipline that deals with the design, construction, and maintenance of the physical and naturally built environment. I may be wrong but hope this helped!
3 0
2 years ago
What does the air change rate represent?
Juli2301 [7.4K]

Answer and Explanation:

  • The removal or addition of air volume to the space is the air change rate
  • The rate of air change is positive when air volume is added to the space and the rate of air change is negative when air volume is removed from the space.
  • The standard built home has a 0.5 to 1 of air change rate.
  • The rate of air change is dependent on the building (how the building form)  

3 0
2 years ago
Other questions:
  • : The interior wall of a furnace is maintained at a temperature of 900 0C. The wall is 60 cm thick, 1 m wide, 1.5 m broad of mat
    12·1 answer
  • Plz help me
    12·1 answer
  • What is a magnitute?
    5·2 answers
  • A can of engine oil with a length of 150 mm and a diameter of 100 mm is placed vertically in the trunk of a car. On a hot summer
    8·1 answer
  • A 5-mm-thick stainless steel strip (k = 21 W/m•K, rho = 8000 kg/m3, and cp = 570 J/kg•K) is being heat treated as it moves throu
    6·1 answer
  • A brake caliper is considered a suspension item.<br> True<br> False
    8·1 answer
  • 5. Liam is working on a circuit and notices it's quite hot to the touch. What's causing the heat Liam Is noticing
    6·1 answer
  • Technician A says a 50/50 mix of antifreeze and
    8·1 answer
  • Tech B says that long-term fuel trims that are positive means that the PCM is leaning out the fuel mixture from the base pulse-w
    11·2 answers
  • Your class is using engineering principles to improve the design of football helmets to prevent brain injury. your teacher divid
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!