Using Python: Write a program that takes a user-inputted integer and prints out the value of...

Using Python:

Write a program that takes a user-inputted integer and prints out the value of pi to the number of decimal places specified by the integer. For example, if the inputted integer is '2' your program should print '3.14'.

Hints:

  • Python's math package includes a constant for pi (as pi). We have imported pi for you in the example code below.
  • The format string syntax for rendering a floating point value to N decimal places is {:.Nf}. The example code below prints pi to 10 decimal places.
  • You will first need to assemble a format string, and then print your result using that format string.

SAMPLE CODE:

from math import pi

# Example input() statement
n = int(input('Please enter an integer: '))

format_string = '{:.10f}'

# Replace this with your own print statement
print(format_string.format(pi))

In: Computer Science

Most health care organization now have some type of online portal where patients can review test...

Most health care organization now have some type of online portal where patients can review test results, message their providers, review other medical information. Research two such portals and share in the discussion board.

In: Biology

Instructions:DevelopaprogramnamedMakeStudentsthat  Reads student data from Readme.txt and creates student instances o usetheStudentclassprovidedforthelab  Saves student...

Instructions:DevelopaprogramnamedMakeStudentsthat

  •  Reads student data from Readme.txt and creates student instances

    o usetheStudentclassprovidedforthelab

  •  Saves student instances in an array list

  •  Displays the size of the list

  •  Iterates through the list displaying students one student per line, as in:

    for (Student s: myList) { System.out.println(s);

    }

    new File("Readme.txt")).useDelimiter(",");

    Then to get each token we can use f.next() or f.nextBoolean()
    Note that student gender is of type char, and that char value can be obtained using

    f.next().charAt(0)

    YoumustusetheStudentclassgivenalongwiththislab. ThisversionofStudentissimpler than the one in the text – this version makes no reference to the Subject class (not needed for this lab).

    Your BlueJ project will include

    Readme.txt, Student.java, and MakeStudents.java

    SubmitMakeStudents.javatotheemailcorrespondingtoyourlabsectionwithsubject Lab 10

Copy the student data provided for this lab to Readme.txt. The data comprises comma-

separated values for fields: first name, last name, gender and active.

Previously we have used the Scanner class with its default delimiter of whitespace. In this

lab, use the Scanner class with comma as the delimiter:

Scanner f = new Scanner

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

public class Student {

// class fields

private static int lastId;

// instance fields

private int id;

private String firstName;

private String lastName;

private char gender;

private boolean active;

// first constructor, no arguments

public Student(){

id = nextId();

// default values for a student:

firstName = "unknown";

lastName = "unknown";

gender = '?';

active = false;

}

// second constructor, four arguments

public Student (String firstName, String lastName, char gender, boolean active){

id = nextId();

//

// when parameters and fields have the same

// name they are distinquished this way:

// a field name alone refers to the parameter

// a field name prefixed with "this."

// refers to an object's fields.

this.firstName = firstName;

this.lastName = lastName;

this.gender = gender;

this.active = active;

}

private int nextId(){

// increment lastId and return the new value

// to be used for the new student.

return ++lastId;

}

public int getId(){

return id;

}

public static int getLastId(){

return lastId;

}

public String getFirstName(){

return firstName;

}

public String getLastName(){

return lastName;

}

public char getGender(){

return gender;

}

public boolean isActive(){

return active;

}

public void setLastId(int newLastId){

lastId = newLastId;

}

// no setter for the student's id field

// public void setId(int newId){

// id = newId;

// }

public void setFirstName(String newFirstName){

firstName = newFirstName;

}

public void setLastName(String newLastName){

lastName = newLastName;

}

public void setGender(char newGender){

gender = newGender;

}

public void setActive(boolean newActive){

active = newActive;

}

public String toString(){

return id+" "+firstName+" "+lastName;

}

public boolean equals(Student s){

return id == s.id;

}

}

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

Readme.txt

Harry,Potter,m,true,Albus,Dumbledore,m,true,Serverus,Snape,m,true,Rubeus,Sirius,m,true,Hermione,Granger,f,true,Ron,Weasley,m,true,Draco,Malfoy,m,true,Luna,Lovegood,f,true,Regulus,Black,m,true,Neville,Longbottom,m,true,Nymphadora,Tonks,f,true,Remus,Lupin,m,true,Fleur,Delacour,f,true,Dolores,Umbridge,f,true,Gellert,Grindelwald,m,true

In: Computer Science

What mass of potassium fluoride must be added to 500.0 mL of water to give a...

What mass of potassium fluoride must be added to 500.0 mL of water to give a solution with pH = 8.07?

[Ka(HF) = 7.1 × 10–4]

A. 68 g    

B. 1.7 × 10–4 g    

C. 1.96 g    

D. 0.95 g   

E. 2.91 g

In: Chemistry

What domain expertise specific information is collected and organized during the problem definition step of a...

What domain expertise specific information is collected and organized during the problem definition step of a data mining spiral?

In: Computer Science

A beam of electrons is shot into a uniform downward electric field of magnitude 1.10 103...

A beam of electrons is shot into a uniform downward electric field of magnitude 1.10 103 N/C. The electrons have an initial velocity of 1.11 107 m/s, directed horizontally. The field acts over a small region, 5.00 cm in the horizontal direction. (a) Find the magnitude and direction of the electric force exerted on each electron. magnitude 1.76e-16 N Correct: Your answer is correct. direction Correct: Your answer is correct. (b) How does the gravitational force on an electron compare with the electric force? The gravitational force is much smaller than the electric force. The gravitational force is much bigger than the electric force. Correct: Your answer is correct. (c) How far has each electron moved in the vertical direction by the time it has emerged from the field? (d) What is the electron's vertical component of velocity as it emerges from the field? (Up is the positive y-direction.) (e) The electrons move an additional 19.4 cm after leaving the field. Find the total vertical distance that they have been deflected by the field.

In: Physics

For this problem, carry at least four digits after the decimal in your calculations. Answers may...

For this problem, carry at least four digits after the decimal in your calculations. Answers may vary slightly due to rounding.

In a marketing survey, a random sample of 998 supermarket shoppers revealed that 280 always stock up on an item when they find that item at a real bargain price.(a) Let p represent the proportion of all supermarket shoppers who always stock up on an item when they find a real bargain. Find a point estimate for p. (Round your answer to four decimal places.)


(b) Find a 95% confidence interval for p. (Round your answers to three decimal places.)

lower limit    
upper limit    


Give a brief explanation of the meaning of the interval.

5% of the confidence intervals created using this method would include the true proportion of shoppers who stock up on bargains.95% of the confidence intervals created using this method would include the true proportion of shoppers who stock up on bargains.    5% of all confidence intervals would include the true proportion of shoppers who stock up on bargains.95% of all confidence intervals would include the true proportion of shoppers who stock up on bargains.


(c) As a news writer, how would you report the survey results on the percentage of supermarket shoppers who stock up on items when they find the item is a real bargain?

Report the margin of error.Report along with the margin of error.    Report the confidence interval.Report .


What is the margin of error based on a 95% confidence interval? (Round your answer to three decimal places.)

16.

–/5

In: Math

how to make a business plan about a truck acessory business? Im really struggling how to...

how to make a business plan about a truck acessory business? Im really struggling how to even start

In: Operations Management

For each of the reactions, calculate the mass (in grams) of the product formed when 15.86...

For each of the reactions, calculate the mass (in grams) of the product formed when 15.86 g of the underlined reactant completely reacts. Assume that there is more than enough of the other reactant.

4Cr(s)+3O2(g)−−−−−→2Cr2O3(s)

M= g

2Sr(s)−−−−+O2(g)→2SrO(s)   

M= g

In: Chemistry

Marcia wants to keep track of each of her customers and their orders. Ultimately, she wants...

Marcia wants to keep track of each of her customers and their orders. Ultimately, she wants to notify them that their clothes are ready via email. Suppose that you have designed a database for Marcia’s Dry Cleaning that has the following tables:

CUSTOMER (CustomerID, FirstName, LastName, Phone, EmailAddress)

INVOICE (InvoiceNumber, CustomerID, DateIn, DateOut, Subtotal, Tax, TotalAmount)

INVOICE_ITEM (InvoiceNumber, ItemNumber, ServiceID, Quantity, UnitPrice, ExtendedPrice)

SERVICE (ServiceID, ServiceDescription, UnitPrice)

The referential integrity constraints are:

CustomerID in INVOICE must exist in CustomerID in CUSTOMER

InvoiceNumber in INVOICE_ITEM must exist in InvoiceNumber in INVOICE

ServiceID in INVOICE_ITEM must exist in ServiceID in SERVICE

Assume that CustomerID of CUSTOMER, EmployeeID of EMPLOYEE, ItemID of ITEM, SaleID of SALE, and SaleItemID of SALE_ITEM are all surrogate keys with values as follows: CustomerID Start at 100 Increment by 1

InvoiceNumber Start at 2018001 Increment by 1

D. Suppose that MArcia decides to allow multiple customers per order (e.g. for customers' spouses). Modify the design of these tables to accommodate this change.

E. Code SQL statements necessary to redesign the database, as described in your answer to question D.

F.Suppose that Marcia considers changing the primary key of CUSTOMER to (FirstName, LastName). Write correlated subqueries to display any data that indicate that this change is not justifiable.

In: Computer Science

Consider the following questions and provide your responses in the form of short answers. Be sure...

Consider the following questions and provide your responses in the form of short answers. Be sure to apply your knowledge from the course thus far and use critical thinking to address these questions thoughtfully and thoroughly. If you use any external sources in your responses, be sure to cite them.

  1. Define the term “globalization” and explain how advances in information technology have stimulated globalization. Describe recent events that provide evidence of globalization.
  2. What is “the digital divide?” Describe the two fundamentally different dimensions of the digital divide.

In: Economics

sorry found a solution!

sorry found a solution!

In: Physics

Do you think that having a government where employees demographically represent the population means that all...

Do you think that having a government where employees demographically represent the population means that all voices have a shot of getting heard? Does having people who look like you in government increase your faith in government? Can a government official who comes from a different background advocate on your behalf?

In: Economics

At some instant, an alpha particle(q=+2e) has the coordinates(3.0,0.0,0.0)(nm) and is moving along the positive x-axis...

At some instant, an alpha particle(q=+2e) has the coordinates(3.0,0.0,0.0)(nm) and is moving along the positive x-axis with 500km/s while an electron at (0.0,4.0,0.0)(nm) is moving along the negative y-axis with 1000km/s.
A)SHOW ALL WORK
Find the magnitude and direction of the total magnetic field at the location(3.0,4.0,0.0)(nm)
B)SHOW ALL WORK
Find the magnitude and direction of the magnetic forces felt by the electron and alpha particle.

In: Physics

A ladder is leaning against a vertical wall, and both ends of the ladder are at...

A ladder is leaning against a vertical wall, and both ends of the ladder are at the point of slipping. The coefficient of friction between the ladder and the horizontal surface is μ1 = 0.295 and the coefficient of friction between the ladder and the wall is μ2 = 0.153. Determine the maximum angle with the vertical the ladder can make without falling on the ground.

In: Physics