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
aleksley [76]
2 years ago
15

I Need Help with 6.1.3 circles in squares in codehs

Computers and Technology
1 answer:
ycow [4]2 years ago
5 0

The program below is able to calculate the area of a circle inscribed in a Square.

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

A program is a set of instructions given to the computer with specific end results in mind.

<u>Sample program in Java

</u>// Java Program to find the area of

// an inscribed circle in a square.

import java.io.*;

class GFG {

   

   static double PI = 3.14;

   

   // Function to find area of an

   // inscribed circle in a square.

   static double areaOfInscribedCircle(float a)

   {

       return ( PI / 4 ) * a * a;

   }

   // Driver code

   public static void main (String[] args)

   {

       float a = 8;

   

       System.out.println("Area of an inscribed"

       + " circle: " + areaOfInscribedCircle(a));

   }

}

Learn more about programs at :
brainly.com/question/1538272
#SPJ1

You might be interested in
Write a program that convert a temperature in Fahrenheit to the equivalent temperature in Celsius. The initial temperature in Fa
baherus [9]

<u>Answer:</u>

//import the necessary class

import java.util.Scanner;

//Begin class definition

public class ConvertToCelsius{

   

       //Begin main method

    public static void main(String []args){

       //Create an object of the Scanner class

       Scanner input = new Scanner(System.in);

       

       //Display the aim of the program

       System.out.println("**Program to convert from Fahrenheit to Celsius**");

       

       //Prompt the user to enter the temperature in Fahrenheit

       System.out.println("Please enter temperature in Fahrenheit");

       

       //Receive the user's input

       //And store in the appropriate variable

       double tempF = input.nextDouble();

       

       //Convert the temperature to Celsius using

       //C = (9.0 / 5) * (F - 32)

       //C = temperature in Celsius, F = temperature in Fahrenheit

       double tempC = (9.0 / 5) * (tempF - 32);

       

       //Display the result

      System.out.println("The temperature in degree Celsius is: ");

       System.out.println(tempC);

       

       return;

       

    }    //End of main method

}    //End of class definition

<u>Sample Output</u>

**Program to convert from Fahrenheit to Celsius **

Please enter temperature in Fahrenheit

>> 32

The temperature in degree Celsius is:  

0.0

<u>Explanation</u>:

The above code has been written in Java and it contains comments explaining important lines of the code. Please go through the comment. Snapshots of the program and a sample output have been attached to this response.

5 0
2 years ago
Comments can be compared to a virtual _____.
Vladimir79 [104]
What's the rest of the question? Like A - B - C - D?
3 0
3 years ago
Setting financial priorities and goals will help you save money for future needs <br> True or false?
allsm [11]
Hey there!

Here is your answer:

<u><em>The proper answer to this question is option A "true".</em></u>

Reason:

<u><em>Financial priorities, and goals would help make a person more money. Goals would include: Opening bank accounts, adding money to some sort of fund, or putting money into a bank account.</em></u>

<em>Therefore the answer is option A!</em>

If you need anymore help feel free to ask me!

Hope this helps!

~Nonportrit 
3 0
3 years ago
Eli has 7 games on his phone. His sister has 6 more than him. Which ratio compares the number of games on Eli’s phone to the num
Ulleksa [173]

Answer:

7:13

Explanation:

First figure out how many his sister has so 6+7=13 so the ratio is 7:13 because of how its worded since it says Eli's games first then thats how you get 7 then his sisters 13 so final answer 7:13 There is you answer

6 0
2 years ago
Read 2 more answers
write a program to evaluate the following postfix expression. the value of each variable must be asked from the user during the
ikadub [295]

In this exercise we have to use the knowledge of computational language in C++ to write a code that program to evaluate the following postfix expression. the value of each variable must be asked from the user during the execution time.

<h3>Writting the code:</h3>

<em>#include <bits/stdc++.h></em>

<em>using namespace std;</em>

<em>// CREATED A </em><em>CLASS </em><em>STACK</em>

<em>class Stack</em>

<em>{</em>

<em>public:</em>

<em> int top;</em>

<em> unsigned sz;</em>

<em> int* ar;</em>

<em>};</em>

<em>// VARIOUS STACK </em><em>FUNCTIONS</em>

<em>Stack* makeStack( unsigned sz )</em>

<em>{</em>

<em> Stack* stack = new Stack();</em>

<em> // BASE </em><em>CONDITION</em>

<em> if (!stack) return NULL;</em>

<em> stack->top = -1;</em>

<em> stack->sz = sz;</em>

<em> stack->ar = new int[(stack->sz * sizeof(int))];</em>

<em> if (!stack->ar) return NULL;</em>

<em> // RETURNING THE STACK</em>

<em> return stack;</em>

<em>}</em>

<em>// CHECKING IF THE STACK IS </em><em>EMPTY</em>

<em>int isEmpty(Stack* stack)</em>

<em>{</em>

<em> return stack->top == -1 ;</em>

<em>}</em>

<em>// CHECKING THE TOP OF THE STACK</em>

<em>int whatAtTop(Stack* stack)</em>

<em>{</em>

<em> return stack->ar[stack->top];</em>

<em>}</em>

<em>// </em><em>POPPING </em><em>OUT OF A STACK</em>

<em>int pop(Stack* stack)</em>

<em>{</em>

<em> if (!isEmpty(stack))</em>

<em>  return stack->ar[stack->top--] ;</em>

<em> return '$';</em>

<em>}</em>

<em>// PUSHING IN THE STACK</em>

<em>void push(Stack* stack, int op)</em>

<em>{</em>

<em> stack->ar[++stack->top] = op;</em>

<em>}</em>

<em>// EVALUATING </em><em>POSTFIX </em><em>STARTS HERE</em>

<em>int postfixEvaluator(string res)</em>

<em>{</em>

<em> // CREATING STACK</em>

<em> Stack* stack = makeStack(res.length());</em>

<em> int i;</em>

<em> // BASE </em><em>CONDITION</em>

<em> if (!stack) return -1;</em>

<em> for (i = 0; res[i]; ++i)</em>

<em> {</em>

<em>  // CHECK FOR SPACES</em>

<em>  if (res[i] == ' ')continue;</em>

<em>  // CHECK FOR THE DIGIT</em>

<em>  else if (isdigit(res[i]))</em>

<em>  {</em>

<em>   int N = 0;</em>

<em>   // EXTRACT THE </em><em>NUMBER </em><em>OUT OF STACK</em>

<em>   while (isdigit(res[i]))</em>

<em>   {</em>

<em>    N = N * 10 + (int)(res[i] - '0');</em>

<em>    i++;</em>

<em>   }</em>

<em>   i--;</em>

<em>   // </em><em>PUSH </em><em>THE NUMBER IN STACK</em>

<em>   push(stack, N);</em>

<em>  }</em>

<em>  // POPPING AND </em><em>ARITHMETIC </em><em>OPERATIONS</em>

<em>  else</em>

<em>  {</em>

<em>   int pos1 = pop(stack);</em>

<em>   int pos2 = pop(stack);</em>

<em>   switch (res[i])</em>

<em>   {</em>

<em>   case '+': push(stack, pos2 + pos1); break;</em>

<em>   case '-': push(stack, pos2 - pos1); break;</em>

<em>   case '*': push(stack, pos2 * pos1); break;</em>

<em>   case '/': push(stack, pos2 / pos1); break;</em>

<em>   }</em>

<em>  }</em>

<em> }</em>

<em> return pop(stack);</em>

<em>}</em>

<em>// MAIN CODE</em>

<em>int main()</em>

<em>{</em>

<em> string tes;</em>

<em> getline(cin, tes);</em>

<em> string tmp = "";</em>

<em> string res = "";</em>

<em> for (int i = 0; i < tes.length(); i++) {</em>

<em>  if (tes[i] <= 'z' and tes[i] >= 'a') {</em>

<em>   tmp += tes[i];</em>

<em>  } else if (tes[i] == ' ' and (tes[i - 1] <= 'z' and tes[i - 1] >= 'a')) {</em>

<em>   cout << "Enter the value of " << tmp << ": ";</em>

<em>   int x; cin >> x;</em>

<em>   res += (to_string(x));</em>

<em>   res += ' ';</em>

<em>   tmp = "";</em>

<em>  } else {</em>

<em>   res += tes[i];</em>

<em>  }</em>

<em> }</em>

<em> cout << "\nThe postfix expression is : " << res;</em>

<em> cout << "\nThe result is : " << postfixEvaluator(res);</em>

<em> return 0;</em>

<em>}</em>

See more about C++ at brainly.com/question/19705654

#SPJ1

8 0
1 year ago
Other questions:
  • A news website uses 32-bit integers to count the number of times an article has been viewed. The website is becoming more popula
    10·1 answer
  • A(n application system is the master controller for all the activities that take place within a computer system. _______________
    15·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Which printout will result from the snippet of code?
    9·1 answer
  • A network administrator is planning redundant devices and cabling in a switched network to support high availability. Which bene
    11·1 answer
  • Please help it would mean to world to me❤️ (WORD)
    13·1 answer
  • What is the component on the motherboard that confirms all devices are in working order once the computer is turned on?
    13·1 answer
  • Describe the different non-printing characters,​
    11·1 answer
  • Anyone know how to delete it in my laptop
    10·1 answer
  • Plz..... Add the following Binary numbers 1. 111000 + 1100 + 111111​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!