Answer:
A. Both approaches are used when writing programs.
Explanation:
Procedural programming (PP), also known as inline programming takes a top-down approach. It is about writing a list of instructions to tell the computer what to do step by step. It relies on procedures or routines. Object-oriented programming (OOP) is about encapsulating data and behavior into objects.
Hope this helps....
Have a nice day!!!!
Thank you for posting your question here. Below is the answer, I hope it helps.
int number = 0;
while (stdin.hasNextInt() && number >= 0){
number =stdin.nextInt();
if (number > 100)
System.out.print(number + " ");
<span>}</span>
Explanation:
In this question
d is known as diameter
r is known as radius
c is known as circumference
pi is known as π
a is known as area
Now, In Maths
Area of circle = π×r×r
Circumference of circle = 2×π×r
Radius (r) = diameter(d)÷2
Given diameter is 6
then, r = 6 ÷2
r = 3
so, diameter = 6
radius = 3
circumference = 2×π×r
= 2×3.14×3 ( the value of π is equal to 3.14)
= 18.84
Area = π×r×r
= 3.14×3×3 ( the value of π is equal to 3.14)
= 28.26
Answer:
- You need to create a variable outside (before) the input loop.
- You need a variable inside your loop that temporarily holds the user input.
- In your loop, you will compare if the variable outside the loop is greater than (or less than) the new user input.
I don't know what program language you are using, but I will use python since it's easy to read and you will get the idea if you're using a different programming language.
<u>Code (Python)</u>
largestnum = 0
for x in range(6): <em>#loops 6 times</em>
newnum = int(input("Enter a number: ")) #ask user for input & converts to int.
if newnum > largestnum: <em>#if new number is greater than largest num </em>
largestnum = newnum <em>#make it the largest number</em>
<em> </em>print("Largest:", largestnum)
The reason why you need a variable outside of the loop is because after the loop is done all variables inside the loop are trashed and can no longer be accessed outside of the loop.