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
charle [14.2K]
2 years ago
9

Write a program to enter RADIUS of a CIRCLE and PRINT AREA of TRIANGLE using Q Basic. (class 8)​

Computers and Technology
1 answer:
Pie2 years ago
6 0

Answer:

The program is as follows:

10 INPUT RADIUS, BASE, HEIGHT

20 CIRCLE = 3.142* RADIUS * RADIUS

30 TRIANGLE = 0.5* BASE * HEIGHT

40 PRINT CIRCLE

50 PRINT TRIANGLE

60 STOP

Explanation:

The program description doesn't tally;

In other words, it is impossible to calculate the area of a triangle using the radius of a circle.

So, I designed the program to get input for radius, base and height.

Get input for radius, base and height

10 INPUT RADIUS, BASE, HEIGHT

Calculate area of circle

20 CIRCLE = 3.142* RADIUS * RADIUS

Calculate area of triangle

30 TRIANGLE = 0.5* BASE * HEIGHT

Print area of circle

40 PRINT CIRCLE

Print area of triangle

50 PRINT TRIANGLE

End of program

60 STOP

You might be interested in
The phone in your hand is a computer. So too is the machine that occupies a 100,000 square foot data center. Given their vast di
Dmitry [639]

Answer:

Well when you think about it they both do the same thing but they are diffirent, they have the same perpose but diffirent parts in them so, when you compair them the phone is smaller and slower, the bigger the computer the better it is depending on the amount of money spent on parts.

5 0
2 years ago
A set of connected ideas supported by examples is ?
andrezito [222]

Answer:

Argument

Explanation:

<u>Argument</u> - A set of connected ideas, supported by examples, made by a writer to prove or disprove a point.

5 0
2 years ago
Read 2 more answers
Write code for a function with the following prototype: /* Addition that saturates to TMin or TMax */ int saturating_add(int x,
Kazeer [188]

Answer:

See explaination

Explanation:

program code.

/* PRE PROCESSOR DIRECTIVES */

#include<stdio.h>

/* PRE-DEFINED VALUES FOR TMAX AND TMIN */

#define TMax 2147483647

#define TMin (-TMax -1)

/* saturating_add(int,int) METHOD IS CALLED HERE */

int saturating_add(int firstNumber, int secondNumber)

{

/*

FOR BETTER UNDERSTANDING, LETS TAKE TEST CASE,

WHERE firstNumber = 5 AND secondNumber = 10

*/

int w = sizeof(firstNumber) << 3;

/*

sizeof(firstNumber) VALUE IS 4, SO USING BINARY LEFT SHIFT OPERATOR TO THREE PLACES,

WE HAVE NOW VALUE 32, ASSIGNED TO w

*/

/* ADDITION IS CALCULATED => 15 */

int addition = firstNumber + secondNumber;

/*

MASK INTEGER VARIABLE IS TAKEN

mask BIT IS LEFT SHIFTED TO 31 PLACES => 2^31 IS THE NEW VALUE

*/

int mask = 1 << (w - 1);

/* FIRST NUMBER MOST SIGNIFICANT BIT IS CALCULATED BY USING AND OPERATOR */

int msbFirstNumber = firstNumber & mask;

/* SECOND NUMBER MOST SIGNIFICANT BIT IS CALCULATED BY USING AND OPERATOR */

int msbSecondNumber = secondNumber & mask;

/* MOST SIGNIFICANT BIT OF ADDITION IS CALCULATED BY USING AND OPERATOR */

int msbAddition = addition & mask;

/* POSITIVE OVERFLOW IS DETERMINED */

int positiveOverflow = ~msbFirstNumber & ~msbSecondNumber & msbAddition;

/* NEGATIVE OVERFLOW IS DETERMINED */

int negativeOverflow = msbFirstNumber & msbSecondNumber & !msbAddition;

/* THE CORRESPONDING VALUE IS RETURNED AS PER THE SATURATING ADDITION RULES */

(positiveOverflow) && (addition = TMax);

(negativeOverflow) && (addition = TMin);

return addition;

}

/* MAIN FUNCTION STARTS HERE */

int main(){

/* TEST CASE */

int sum = saturating_add(5, 10);

/* DISPLAY THE RESULT OF TEST CASE */

printf("The Sum Is : %d\n\n",sum);

}

7 0
3 years ago
Pls due soon
Natasha_Volkova [10]

Answer:

Software for personal computers is typically developed and distributed independently from the hardware or operating system manufacturers. Many personal computer users no longer need to write their own programs to make any use of a personal computer, although end-user programming is still feasible. This contrasts with mobile systems, where software is often only available through a manufacturer-supported channel. And end-user program development may be discouraged by lack of support by the manufacturer.

Explanation:

5 0
3 years ago
What would the following program print to the screen when run?
Lady bird [3.3K]

Answer:

The output will be:

B

o

n

d

0

0

7

Explanation:

Given code is of Python language

Let us look at the code line by line

The first line is:

my_list = [7, 0, 0, "d", "n", "o", "B"]

This line will create a list with the given elements.

my_list.reverse()

This line will reverse the sequence of the elements of the list

for thing in my_list:

print (thing)

These lines will simply print the reversed elements of the list on screen.

The output will be:

B

o

n

d

0

0

7

8 0
2 years ago
Other questions:
  • Para saan po yung points dito?
    15·1 answer
  • How to cite a website, like asha.org?
    6·1 answer
  • A sequence of one or more characters is called
    14·1 answer
  • Peripeteia is also referred to as __________.
    5·2 answers
  • What is wrong with the following code?
    11·1 answer
  • What is output?
    13·1 answer
  • Please choose odd one out please tell fast ​
    13·2 answers
  • Explain the use of mail merge feature. <br>pls help​
    9·1 answer
  • What is the purpose of quick access toolbar?
    7·1 answer
  • Which of the following is the system of rules and structure governing
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!