Write out code for a nested if statement that allows a user to enter in a product name, store the product into a variable called product_name and checks to see if that product exists in your nested if statement. You must include 5 product names to search for. If it is then assign the price of the item to a variable called amount and then print the product name and the cost of the product to the console. If it does not find any of the items in the nested if statement, then print that item cannot be found.

Answers

Answer 1

Answer:

product_name = input("Enter product name : ")

if product_name=="pen"or"book"or"box"or"pencil"or"eraser":

   if product_name == "pen":  

       amount = 10

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "book":

       amount = 100

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "box":  

       amount = 150

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "pencil":  

       amount = 5

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "eraser":

       amount = 8

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

else:  

   print("Item not found!")

Explanation:

The python program is a code of nested if-statements that compares the input string to five items of the first if-statement. For every item found, its code block is executed.


Related Questions

Suppose you decide to use the number of times you see any of the area codes of the places Yanay has been to in 50 spam calls as your test statistic. Question 7. Write a function called simulate_visited_area_codes that generates exactly one simulated value of your test statistic under the null hypothesis. It should take no arguments and simulate 50 area codes under the assumption that the result of each area is sampled from the range 200-999 inclusive with equal probability. Your function should return the number of times you saw any of the area codes of the places Yanay has been to in those 50 spam calls. Hint: You may find the textbook section on the sample_proportions function to be useful. For model_proportions, under the null hypothesis, what's the chance of drawing one of the area codes Yanay has recently been to

Answers

Answer:

In Python:

import random

def simulate_visited_area_codes():

   area_codes = []

   for i in range(51):

       num = random.randint(200,1000)

       area_codes.append(num)

   visited_codes = [289, 657, 786, 540]

   count = 0

   for i in range(51):

       for j in range(len(visited_codes)):

           if area_codes[i] == visited_codes[j]:

               count+=1

   return count

print("Visited Areas: "+str(simulate_visited_area_codes()))

Explanation:

So many incomplete details in your question, so I will fill in the gap (i.e. make assumptions)

The assumptions are:

The 50 area codes is stored in area_codes list; the codes are randomly generatedThe visited area codes is stored in visited_codes list, the list is initializes with [289, 657, 786, 540]

The program and explanation is as follows: (comments are written in bold)

#This imports the random module

import random

#This defines the function

def simulate_visited_area_codes():

#Thie initializes area_codes to an empty list

   area_codes = []

#This iterates from 1 to 50 and generate 50 random numbers to the area_codes list

   for i in range(51):

       num = random.randint(200,1000)

       area_codes.append(num)

#This initializes the visited_code

   visited_codes = [289, 657, 786, 540]

#This initializes count variable to 0

   count = 0

#This iterates through the list and looks for matching code between the area_code and the visited_code lists

   for i in range(51):

       for j in range(len(visited_codes)):

           if area_codes[i] == visited_codes[j]:

#The count variable is incremented by 1 for matching codes

               count+=1

#This returns the count

   return count

#The main begins here and prints the number of area code visited

print("Visited Areas: "+str(simulate_visited_area_codes()))

Simulate Function:

Simulate one or more responses from the distribution corresponding to a fitted model object.

The code is shown below:-

visited_test_statistics_under_null = make_array()

repetitions = 20000

for i in np.arange(repetitions):

  new_sum_of_correct_area_code = simulate_visited_area_codes()

  visited_test_statistics_under_null = np.append(visited_test_statistics_under_null, new_sum_of_correct_area_code)

visited_test_statistics_under_null( )

Learn more about the topic Simulate Function:

https://brainly.com/question/14492046

PLEASE SOMEONE ANSWER THIS

If the old code to a passcode was 1147, and someone changed it, what would the new code be?


(It’s no version of 1147, I already tried that. There are numbers at the bottom of the pictur, it just wouldn’t show.)




[I forgot my screen time passcode please someone help I literally can’t do anything on my phone.]

Answers

Answer:

There's no way for anyone but you to know the password. Consider this a lesson to be learned - keep track of your passwords (and do it securely). If you can't remember your password for this, the only alternative is to factory reset your device.

I don't know exactly if this passcode instance is tied to your Icloud account.. if it is, factory resetting will have been a waste of time if you sign back into your Icloud account. In this case, you would need to make a new Icloud account to use.

Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a list that contains only the non-strings from the original list. It is acceptable to return an empty list if there are only strings in the original list. This question uses the filter pattern discussed in lecture.

Answers

Answer:

Explanation:

The following code is written in Python and is a simple function that removes all of the type String elements within the list that has been passed as an argument. Then finally, prints out the list and returns it to the user.

def filter_out_str(list):

   for x in list:

       if type(x) == type(" "):

           list.remove(x)

   print(list)

   return list

Following are the python code to hold only string value into another list by using the given method:

Python code:

def filter_only_strs(l):#defining the method filter_only_strs that takes list type variable l in parameter

   r = []#defining an empty list r

   for x in l:#defining a loop that counts value of list

       if isinstance(x, str):#using if block that check list value is in string

           r.append(x)#using an empty list that holds string value

   return r#return list value

l=['d',12,33,"data"]#defining a list l

print(filter_only_strs(l))#calling the method filter_only_strs

Output:

Please find the attached file.

Program Explanation:

Defining the method "filter_out_strs", which takes one argument of list type that is "l".Inside the method, an empty list "r" is defined, and in the next line, a for loop is declared.Inside the for loop list "l" is used with a conditional statement that uses the "isinstance" method that checks string value in the list and adds its value in "r", and returns its value.

Find out more about the list in python here:

brainly.com/question/24941798

2. Write a Python regular expression to replace all white space with # in given string “Python is very simple programming language.”

Answers

Dear Parent, Please note that for your convenience, the School Fee counter would remain open on Saturday,27th March 2021 from 8am to 2 pm. Kindly clear the outstanding amount on account of fee of your ward immediately either by paying online through parent portal or by depositing the cheque at the fee counter to avoid late fee charges.For payment of fee the following link can also be used Pay.balbharati.org

This feature in Word Online allows you to view your document to see what it will look like when printed.

Open
Print Preview
Save
Sneak Preview

Answers

Answer:

Print preview allows you to view your document before printing

Answer: they are correct, the answer is print preview! (i did the quiz)

Explanation:

you can give them brianliest now!

Write as many accurate and relevant statements about the following prompt as you can think of. You are free to use any of the resources provided to you. Drawings with descriptions of their meanings can be considered a response. A total of 5 correct responses will provide full credit for the assignment and incorrect responses will not effect the number of points received on the exercise.

Answers

Answer:

1. The structure is prone to hydrophobic interaction due to the presence of a hydrophobic side chain.

2. The amino acid side chain can form hydrogen bonds due to the presence of hydrogen and nitrogen.

3. It is the primary structure of proteins (polypeptides)

4. With the presence of sulfur in the amino acid, disulfide linkage can be formed.

5.  Both structures are Cysteine and histidine side chains of amino acids.

Explanation:

Proteins are organic materials. The two structures are the primary structures of the primary protein molecule which is the amino acid. They can be found in both plants and animals as it promotes cellular regeneration of damaged tissues and cell and the development of organs in living things. It is also found naturally in other materials in our enviroment.

Consider the following static method, calculate.

public static int calculate(int x)
{
x = x + x;
x = x + x;
x = x + x;

return x;
}
Which of the following can be used to replace the body of calculate so that the modified version of calculate will return the same result as the original version for all values of x?

return 8 * x;
return 3 + x;
return 3 * x;
return 6 * x;
return 4 * x;

Answers

Answer:

return 8 * x;

Explanation:

Required

What can replace the three lines of x = x + x

We have, on the first line:

[tex]x=>x +x[/tex]

[tex]x=>2x[/tex]

On the second line:

[tex]x=>x +x[/tex]

[tex]x=>2x[/tex]

Recall that, the result of line 1 is: [tex]x=>2x[/tex]

So, we have:

[tex]x=>2 * 2x[/tex]

[tex]x=>4x[/tex] --- at the end of [tex]line\ 2[/tex]

On the third line:

[tex]x=>x +x[/tex]

[tex]x=>2x[/tex]

Recall that, the result of line 2 is: [tex]x=>4x[/tex]

So, we have:

[tex]x = 2 * 4x[/tex]

[tex]x => 8x[/tex]

So: 8 * x can be used

if a mosquito on the right is moving 10m/s and has kinectic enegry 0.25 j what is the mass​

Answers

Answer:

Mass = 0.005 kg

Explanation:

Given:

Velocity V = 10 m/s

kinetic energy 0.25 j

Find:

Mass of mosquito

Computation:

K.E = 1/2(m)(v²)

0.25 = 1/2(m)(10²)

0.5 = m x 100

Mass = 0.005 kg

This is computer and programming

Answers

Answer:yes

Explanation:because

up to 25 miles i think sorry is wrong

which of the following is not an aspect of form
A Emotion.
B Color.
C Shape.
D Rhythm

Answers

answer is A. Emotion

Write code that sets the value of a variable named delicious to True if jellybeans is greater than 20, or licorice is greater than 30, or their sum is greater than 40. Otherwise, set it to False. Do NOT use an if statement in your solution. Assume jellybeans and licorice already have values.

Answers

Answer:

jellybeans = 10

licorice = 35

delicious = (jellybeans > 20) or (licorice > 30) or ((jellybeans + licorice) > 40)

print(delicious)

Explanation:

*The code is in Python.

Set the jellybeans and licorice to any values you like

In order to have the value of True or False without using the if statement, we need to set delicious as boolean variable. As you may know, boolean variables are the variables that have a value of either True or False

Check if jellybeans is greater than 20 or not → (jellybeans > 20)

Check if licorice is greater than 30 or not → (licorice > 30)

Check if their sum is greater than 40 or not → ((jellybeans + licorice) > 40)

All of the above expressions are boolean expressions. They return True if the statement is correct. Otherwise, they return False

Also, note that we combined all the expressions with or

For these values → jellybeans = 10, licorice = 35:

The first statement returns False

The second statement returns True

The third statement returns True

delicious = False or True or True → True

Note that if the expressions are combined with or, the result will be True if one of the expression is True.

The code that sets the value of a variable named delicious to True if jellybeans is greater than 20, or licorice is greater than 30, or their sum is greater than 40 is as follows:

jellybeans = 30

licorice = 35

delicious = (jellybeans > 20) or (licorice  > 30) or (jellybeans + licorice > 40)

print(delicious)

Code explanationThe first line of code, we declared a variable called jellybeans and initialise it to 30.The second line of code, we declared a variable called licorice and initialise it to 35.Then the variable "delicious" is used to store the condition if jelly fish is greater than 20 or if licorice is greater than 30 or the sum of licorice and jellyfish is greater than 40 If any of the condition is true, the print statement will print out True else it will print False.

learn more variable here : https://brainly.com/question/19661456?referrer=searchResults

In cell F5, enter a formula using the PMT function. Insert a negative sign (-) after the equal sign in the formula to display the result as a positive amount. Use defined names for the rate, nper, and pv arguments as follows:
· rate argument: Divide the Rate by 12 to use the monthly interest rate.
· nper argument: Multiply the Term by 12 to specify the number of months as the periods.
· pv argument: Use the Loan_Amount as the present value of the loan.
2.In cell F6, enter a formula without using a function that multiplies 12 by the Term and the Monthly_Payment, and then subtracts the Loan_Amount to determine the total interest
3. in cell J5, enter another formula using the PV function. Use defined cell names for the rate, nper, and pmt arguments as follows:
· rate argument: Divide the Rate by 12 to use the monthly interest rate.
· nper argument: Subtract the year value in cell H5 from the Term, and then multiply the result by 12 to specify the number of months remaining to pay off the loan.
· pmt argument: Use the Monthly_Payment as a negative value to specify the payment amount per period.

Answers

Answer:

Open MS-Office Excel (a.) Define name for rate, nper and pv cells as Rate, Term and Loan_Payment. Select the cell then Menu > Formulas

what is difference between computer and smartphone

Answers

Answer: One is smaller than the other.

Write a SELECT statement that uses aggregate window functions to calculate the order total for each customer and the order total for each customer by date. Return these columns: The customer_id column from the Orders table The order_date column from the Orders table The total amount for each order item in the Order_Items table The sum of the order totals for each customer The sum of the order totals for each customer by date (Hint: You can create a peer group to get these values)

Answers

Answer:

1. SELECT Order.customer_id, SUM(order_total) AS 'Total_order'  

FROM Order JOIN Order_item

WHERE Order.customer_id = Order_item.customer_id

GROUP BY Order.customer_id

2. SELECT Order.customer_id, SUM(order_total) AS 'Total_order' , order_date

FROM Order JOIN Order_item

WHERE Order.customer_id = Order_item.customer_id

GROUP BY Order.customer_id, Order_item.order_date

ORDER BY Order_item.order_date

Explanation:

Both SQL queries return the total order from the joint order and order_item tables, but the second query returns the total order and their data grouped by customer and order date and also ordered by the order date.

. Suppose an instruction takes 1/2 microsecond to execute (on the average), and a page fault takes 250 microseconds of processor time to handle plus 10 milliseconds of disk time to read in the page. (a) How many pages a second can the disk transfer? (b) Suppose that 1/3 of the pages are dirty. It takes two page transfers to replace a dirty page. Compute the average number of instructions between page fault that would cause the system to saturate the disk with page traffic, that is, for the disk to be busy all the time doing page transfers.

Answers

Answer:

a. 100.

b. 31500.

Explanation:

So, we are given the following data which is going to help in solving this particular question.

The time required to execute (on the average) = 1/2 microsecond , a page fault takes of processor time to handle = 250 microseconds and the disk time to read in the page = 10 milliseconds.

Thus, the time taken by the processor to handle the page fault = 250 microseconds / 1000 = 0.25 milliseconds.

The execution time = [ 1/2 microseconds ]/ 1000 = 0.0005 milliseconds.

The number of Pages sent in a second by the disc = 1000/10 milliseconds = 100.

Assuming U = 1.

Hence, the disc transfer time = [2/3 × 1 } + [ 1/3 × 0.25 milliseconds + 15 ] × 2.

=0.667 + 15.083.

= 15.75 millisecond.

Average number of instruction = 15.75/0.0005 = 31500.

It should be noted that the number of pages in a second will be 100 pages.

From the information given, it was stated that the instruction takes 1/2 microsecond to execute and a page fault takes 250 microseconds of processor time to handle plus 10 milliseconds of disk time to read the page.

Therefore, the execution time will be:

= 0.5/1000

= 0.0005

Therefore, the number of pages will be:

= 1000/10

= 100

Also, the disc transfer time will be;

= (2/3 × 1) + (1/3 × 0.25 + 15) × 2

= 0.667 + 15.083

= 15.75

Therefore, the average number of instructions will be:

= 15.75/0.0005

= 31500

Learn more about time taken on:

https://brainly.com/question/4931057

helpppp me please..
........​

Answers

Answer:

The employer's monthly salary (X)

Create a Department object which contains a name (String), budget (double), and an ArrayList of Employee objects. Each Employee object contains a FirstName (String). LastName(String), and an Address object. Each Address object contains a Street (String), Apartment (int), City (String), and State as a char array of length 2. The Apartment parameter is optional but the other three are mandatory! Ensure no Address object can be created that does not have them. Finally, create a test program that allows users to Add, Delete, Print, and Search the Employees of a Department.

Answers

Answer:

Explanation:

The following code is very long and is split into the 4 classes that were requested/mentioned in the question: Department, Employee, Address, and Test. Each one is its own object with its own constructor. Getters and Setters were not created since they were not requested and the constructor handles all of the variable creation. Address makes apartment variable optional by overloading the constructor with a new one if no argument is passed upon creation.

package sample;

import sample.Employee;

import java.util.ArrayList;

class Department {

   String name = "";

   double budget = 0;

   ArrayList<Employee> employees = new ArrayList<>();

   void Department(String name, double budget, ArrayList<Employee> employees) {

       this.name = name;

       this.budget = budget;

       this.employees = employees;

   }

}

------------------------------------------------------------------------------------------------------------

package sample;

public class Employee {

   String FirstName, LastName;

   Address address = new Address();

   public void Employee(String FirstName, String LastName, Address address) {

       this.FirstName = FirstName;

       this.LastName = LastName;

       this.address = address;

   }

}

-------------------------------------------------------------------------------------------------------------

package sample;

class Address {

   String Street, City;

   int apartment;

   char[] state;

   public void Address(String street, String city, char[] state, int apartment) {

       this.Street = street;

       this.City = city;

       this.state = state;

       this.apartment = apartment;

   }

   public void Address(String street, String city, char[] state) {

       this.Street = street;

       this.City = city;

       this.state = state;

       this.apartment = 0;

   }

}

-------------------------------------------------------------------------------------------------------------

package sample;

public class Test extends Department {

   public void add(Department department, Employee employee) {

       department.employees.add(employee);

   }

   public void delete(Department department, Employee employee) {

       for (int x = 0; x < department.employees.size(); x++) {

           if (department.employees.get(x) == employee) {

               department.employees.remove(x);

           }

       }

   }

   public void Print(Department department, Employee employee) {

       for (int x = 0; x < department.employees.size(); x++) {

           if (department.employees.get(x) == employee) {

               System.out.println(employee);

           }

       }

   }

   public void Search (Department department, Employee employee) {

       for (int x = 0; x < department.employees.size(); x++) {

           if (department.employees.get(x) == employee) {

               System.out.println("Employee is located in index: " + x);

           }

       }

   }

}

Research: Using the Internet or a library, gather information about the Columbian Exchange. Takes notes about the specific goods and diseases that traveled back and forth across the Atlantic, as well the cultural and political changes that resulted. Pay special attention to the indigenous perspective, which will most likely be underrepresented in your research.

Answers

Answer:

Small pox, cacao, tobacco, tomatoes, potatoes, corn, peanuts, and pumpkins.

Explanation:

In the Columbian Exchange, transportation of plants, animals, diseases, technologies, and people from one continent to another held. Crops like cacao, tobacco, tomatoes, potatoes, corn, peanuts, and pumpkins were transported from the Americas to rest of the world. Due to this exchange, Native Americans were also infected with smallpox disease that killed about 90% of Native Americans because this is a new disease for them and they have no immunity against this disease. Due to this disease, the population of native Americans decreases and the population of English people increases due to more settlement.

Suppose you design a banking application. The class CheckingAccount already exists and implements interface Account. Another class that implements the Account interface is CreditAccount. When the user calls creditAccount.withdraw(amount) it actually makes a loan from the bank. Now you have to write the class OverdraftCheckingAccount, that also implements Account and that provides overdraft protection, meaning that if overdraftCheckingAccount.withdraw(amount) brings the balance below 0, it will actually withdraw the difference from a CreditAccount linked to the OverdraftCheckingAccount object. What design pattern is appropriate in this case for implementing the OverdraftCheckingAccount class

Answers

Answer:

Strategy

Explanation:

The strategic design pattern is defined as the behavioral design pattern that enables the selecting of a algorithm for the runtime. Here the code receives a run-time instructions regarding the family of the algorithms to be used.

In the context, the strategic pattern is used for the application for implementing OverdraftCheckingAccount class. And the main aspect of this strategic pattern  is the reusability of the code. It is behavioral pattern.

Suppose Alice and Bob have RSA public keys in a file on a server. They communicate regularly using authenticated, confidential messages. Eve wants to read the messages but is unable to crack the RSA private keys of Alice and Bob. However, she is able to break into the server and alter the file containing Alice's and Bob's public keys. a. How should Eve alter that file so that she can read confidential messages sent between Alice and Bob, and forge messages from either

Answers

Answer:

On the server, Eve could create and register her own version of Bob's and Alice's pairs of keys, then she can intercept the communication between Bob and Alice, decrypt the message and recalculate the hash, and also re-encrypting it all with her own version of Bob's and Alice's private and public keys.

Explanation:

Cryptography is the study of various methods to secure communication between two parties in the presence of a third known as adversaries.

Messages sent through communication mediums are encrypted to protect the confidentiality and integrity of their content. Using secure pins known as keys are used in some type of cryptography to encrypt and decrypt messages.

These keys are protected from adversaries and should be secured in servers.

At a coffee shop, a coffee costs $1. Each coffee you purchase, earns one star. Seven stars earns a free coffee. In turn, that free coffee earns another star. Ask the user how many dollars they will spend, then output the number of coffees that will be given and output the number of stars remaining. Hint: Use a loop

Answers

Answer:

Explanation:

The following is written in Python, no loop was needed and using native python code the function is simpler and more readable.

import math

 

def coffee():

   dollar_amount = int(input("How much money will you be using for your purchase?: "))

   free_coffees = math.floor(dollar_amount / 7)

   remaining_stars = dollar_amount % 7

   print("Dollar Amount: " + str(dollar_amount))

   print("Number of Coffees: " + str(dollar_amount + free_coffees))

   print("Remaining Stars: " + str(remaining_stars))

Suppose that a computer has three types of floating point operations: add, multiply, and divide. By performing optimizations to the design, we can improve the floating point multiply performance by a factor of 10 (i.e., floating point multiply runs 10 times faster on this new machine). Similarly, we can improve the performance of floating point divide by a factor of 15 (i.e., floating point divide runs 15 times faster on this new machine). If an application consists of 50% floating point add instructions, 30% floating point multiply instructions, and 20% floating point divide instructions, what is the speedup achieved by the new machine for this application compared to the old machine

Answers

Answer:

1.84

Explanation:

Operation on old system

Add operation = 50% = 0.5

Multiply = 30% = 0.3

Divide = 20% = 0.2

T = total execution time

For add = 0.5T

For multiplication = 0.3T

For division = 0.2T

0.5T + 0.3T + 0.2T = T

For new computer

Add operation is unchanged = 0.5T

Multiply is 10 times faster = 0.3T/10 = 0.03T

Divide is 15 times faster = 0.2T/15= 0.0133T

Total time = 0.5T + 0.03T + 0.0133T

= 0.54333T

Speed up = Old time/ new time

= T/0.54333T

= 1/0.54333

= 1.84

What values are stored in nums after the following code segment has been executed?

int[] nums = {50, 100, 150, 200, 250};
for (int n : nums)
{
n = n / nums[0];
}
[1, 2, 3, 4, 5]
[1, 1, 1, 1, 1]
[1, 100, 150, 200, 250]
[50, 100, 150, 200, 250]
An ArithmeticException is thrown.

Answers

Answer:

D.[50, 100, 150, 200, 250]

Explanation:

This is a trick question because the integer n is only a counter and does not affect the array nums. To change the actual array it would have to say...nums[n] = n/nums[0];

(08.02 LC)
It is appropriate to leave sections of an application blank.
O True
O False

Answers

Explanation:

it is false because it is not appropriate

I think it is false to

37) Which of the following statements is true
A) None of the above
B) Compilers translate high-level language programs into machine
programs Compilers translate high-level language programs inton
programs
C) Interpreter programs typically use machine language as input
D) Interpreted programs run faster than compiled programs​

Answers

Answer:

B

Explanation:

its b

Answer:

A C E

Explanation:

I got the question right.

Which cable standard is a standard for newer digital cable, satellite, and cable modem connections?

Answers

Answer:

Coaxial cable

Explanation:

Objective
Make a function that solves the quadratic equation, outputting both values of X. You do not have to worry about imaginary numbers. That is, I will only use input that creates a real output (such as the example screenshots).
NOTE: A function that uses the C version of pass by reference is required to get full credit on this assignment. The C++ form of pass by reference will receive no credit.
Details
STEP 1
#include at the top of your file so that you can use the sqrt function. The sqrt function calculates the square root. For example:
int x = sqrt(9.0)
Will leave x with the value 3, which is the square root of 9.
STEP 2
Define a function THAT USES PASS BY REFERENCE to take in three double inputs and provides two double outputs. In the equations below I use a, b, and c as the double input names and x1 and x2 as the output names.
Inside this function solve the quadratic equation for both possible values of x:
X 1 = − b + b 2 − 4 a c 2 a
That is, X1 is equal to -b + sqrt(b * b - 4 * a * c) then divide all of that by 2 * a.
X 2 = − b − b 2 − 4 a c 2 a
That is, X2 is equal to -b - sqrt(b * b - 4 * a * c) then divide all of that by 2 * a.
Note the difference. One adds sqrt(b * b - 4 * a * c) and the other subtracts it.
This can be done in several lines of code if you want or you can attempt to perform the entire calculation in one line of code.
STEP 3
In the main function read in 3 inputs from the user. Pass these inputs to the quadratic equation function along with the pass by reference variables for the output. Print the results to the screen.
Advice
Your quadratic equation function does NOT need to account for imaginary numbers. Stick with the example inputs to test your code.
If you get NAN that means your equation has an imaginary solution. Do not worry about it. Try different inputs.
The calculation itself is a minor portion of this grade. The majority of the grade comes from implementing pass by reference so make sure you have that part correct.
b2 is simple enough that you do not need to call the pow() function to calculate the power. Instead multiply b * b.
You may want to calculate the numerator into one variable and the denominator into another. You don't have to solve the entire equation on one line (though that is possible).
Since you are using pass by reference you can make the QuadraticEquation function into a void function. It does not need to return anything since it is returning calculations via pointers.
Use scanf on one variable at a time. Don't forget to use double data types and %lf with scanf.

Answers

Answer:

In C

#include <stdio.h>

#include<math.h>

void myfunc(double *a, double *b, double *c) {

  double x1, x2;

  x1 = (-(*b) + sqrt((*b)*(*b)- 4*(*a)*(*c)))/(2*(*a));

  x2 = (-(*b) - sqrt((*b)*(*b) - 4*(*a)*(*c)))/(2*(*a));

  printf("x1 = %f\n",x1);

  printf("x2 = %f\n",x2);}

int main () {

  double a,b,c;

  printf("a: "); scanf("%lf", &a);

  printf("b: "); scanf("%lf", &b);

  printf("c: "); scanf("%lf", &c);

  myfunc(&a, &b, &c);

  return 0;}

Explanation:

#include <stdio.h>

#include<math.h>  --- This represents step 1

Step 2 begins here

This gets the values of a, b and c from main by reference

void myfunc(double *a, double *b, double *c) {

This declares x1 and x2

  double x1, x2;

Calculate x1

  x1 = (-(*b) + sqrt((*b)*(*b)- 4*(*a)*(*c)))/(2*(*a));

Calculate x2

  x2 = (-(*b) - sqrt((*b)*(*b) - 4*(*a)*(*c)))/(2*(*a));

Print x1

  printf("x1 = %f\n",x1);

Print x2

  printf("x2 = %f\n",x2);}

Step 3 begins here

int main () {

Declare a, b and c as double

  double a,b,c;

Get input for a, b and c

  printf("a: "); scanf("%lf", &a);

  printf("b: "); scanf("%lf", &b);

  printf("c: "); scanf("%lf", &c);

Call the function to calculate and print x1 and x2

  myfunc(&a, &b, &c);

  return 0;}

1. P=O START: PRINT PP = P + 5 IFP
<=20 THEN GOTO START: * what is output​

Answers

Answer:

0

5

10

15

20

Explanation:

P=O should be P=0, but even with this error this is the output.

When P reaches 20 it will execute the loop once more, so 20 gets printed, before getting increased to 25, which will not be printed because then the loop ends.

what is computer? different between RAM and ROM?​

Answers

Answer:

RAM, which stand for RANDOM ACESS MEMORY and ROM whitch stand for READ ONLY MEMORY, are both present in your computer. RAM volatile memory that temporary store the file you are working on. ROM is a non volatile memory that permanently stores instruction for your COMPUTER.

Recall that within the LinkedCollection the numElements variable holds the number of elements currently in the collection, and the head variable of type LLNode holds a reference to the beginning of the underlying linked list. The LLNode class provides setters and getters for its info and link attributes. Complete the implementation of the add method:

public boolean remove (T target)
// Removes an element e from this collection such that e.equals (target)
// and returns true; if no such element exists, returns false.
find(target);
if (found)
// complete the method body
return found;

Answers

yeah its totally rghe 5fith ob dExplanation:

Other Questions
1. Please identify the type of phrase that is underlined. *Lilly, (my favorite dog,) loves belly rubs.-Prepositional-Appositive-Gerund-Participial-Infinitive in a certain chemical the ratio of zinc to Copper is for 4 to 11 a jar of the chemical contains 385 grams of copper how many grams of zinc does it contain. 100% is shown on the following tape diagram.?100%What percent is represented by the entire tape diagram?% Exit Which number comes last if the numbers 0.000000009, 0.0450, 321.598, and 1.0000001 are arranged in order from fewest to most significant digits? A. 1.0000001 B. 321.598 C. 0.0450 D. 0.000000009 Choose the correct future tense form of the verb in parentheses.Ella (decir) la verdad. HELPPPPP!!!! plsssssss helppppppppp plzzzzzz In the earlier class, you had prepared the solution of dry yeast for observation of dry yeast. Which substance is preapred by its use on commercial basis?plz ans this in one line cupcakes for a bake sale. He can bake 45cupcakes in one hour. Which inequality shows the minimum number of hours that Hannah must bake to make at least 250cupcakes? Solve and show your workWhat is the workformula?Kevin delivers 30newspapers in 2 hours. How many newspapers can bedeliver in 3 hours? Find the unit rate first to solve this two-step problem Prove that the value of the expression (2^10+2^8)(2^5-2^3) is divisible by 60I WILL MARK BRAINLIEST!!!!!!1Should be written like __*60Fill in the blank Solve for x: |x| 8 = 5 The difference in base sequence between the non-template strand and the mRNAstrand is that there is (thymine/uracil).in the DNA strand but there is(thymine/uracil).in the mRNA strand. What did the Harlem Renaissance do for African Americans?-It encouraged African Americans to leave the South to pursue work in Harlem,where African Americans were considered equals.-It worked to change white citizens' perceptions of African Americans as primarilylaborers.-It provided African Americans an opportunity to create a new identity forthemselves by using art to express their feelings and experiences.-It reminded white citizens that African Americans continued to suffer unjusttreatment because of their race. Un contenedor de 120 lt de capacidad contiene 90 lt de un lquido que porcebtaje de la capacidad del tanque est desocupado Three people go out to lunch. They decideto share the $69.00 bill evenly. How muchdoes each person pay? A sign in a bakery gives the following options: Option A is 12 cupcakes for $30. Option B is 24 cupcakes for $66. Option C is 50 cupcakes for $129. What is the cost of one cupcake for Option A? I need help please !!! Pls help me in one question in math How does poor study habits impact the learners ability to study effectively?