answer.
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
leonid [27]
2 years ago
15

Write a program that asks the user to enter a name, and then prints

Computers and Technology
2 answers:
Digiron [165]2 years ago
6 0

Answer:

user_name = input("Please enter a name or type Nope to terminate the program: ")

while( user_name != "Nope" ):

   print("Nice to meet you ", user_name )

   user_name = input("Please enter a name or type Nope to terminate the program: ")

Explanation:

Get the name from user as an input and store it in the user_name variable.

Run a while loop until user_name is not equal to the value of Nope.

Inside the while loop, display the name of user and repeat the question until user types Nope.

Amanda [17]2 years ago
6 0

Answer:

while True:

   your_name = input('Please Enter Your Name: ')

   if your_name == 'Nope':

       break

   print('Welcome to My Page {}'.format(your_name))

Explanation:

This program will print the name unless name is Nope. Please do make sure indentation is mentained.

Result

Please Enter Your Name: Joe

Welcome to My Page Joe

Please Enter Your Name: Nick

Welcome to My Page Nick

Please Enter Your Name: Rose

Welcome to My Page Rose

Please Enter Your Name: Nope

You might be interested in
Select the examples that best demonstrate likely employers for Journalism and Broadcasting workers. Check all that apply.
Delicious77 [7]

Answer:

a radio station

a newspaper

a television network

Explanation:

4 0
1 year ago
Read 2 more answers
List three functions that you can perform with a database that you cannot perform with a spreadsheet.
Delicious77 [7]
There are some function which can be performed with database but not with a spread sheet, these functions include: 
1. Enforcement of data type.
2. Support for self documentation.
3. Defining the relationship among constraints in order to ensure consistency of data.
5 0
1 year ago
3.14 LAB: Simple statistics for Python
Ad libitum [116K]

Answer:

Following are the correct python code to this question:

n1 = float(input('Input first number: '))#input first number  

n2 = float(input('Input second number: '))#input second number  

n3 = float(input('Input third number: '))#input third number  

n4 = float(input('Input fourth number: '))#input fourth number  

average = (n1+n2+n3+n4)/4 #calculate input number average

product = n1*n2*n3*n4 # calculate input number product

print('product: {:.0f}  average: {:.0f}'.format(round(product),round(average))) #print product and average using round function

print('product: {:.3f}  average: {:.3f}'.format(product,average)) #print product and average value

Output:

Please find the attachment.

Explanation:

The description of the above python code can be defined as follows:

  • In the above python program four variable "n1, n2, n3, and n4" is defined, in which we take input from the user end, and in these user inputs we use the float method, that converts all the input value in to float value.
  • In the next step, two variable average and product are defined, that calculate all input numbers product, average, and hold value in its variable.
  • In the last line, the print method is used, which prints its variable value by using a round and format method.

8 0
2 years ago
To gain experience of using and combing different sorting algorithms: election sort, insertion sort, merge sort, and quick sort.
ch4aika [34]

Answer:

Motivation? The search problem.

Sorting algorithms: insertion sort, shellsort, heapsort, mergesort, quicksort, bubblesort

At the very least, "general purpose" sorting algorithms require O(n log n) comparisons

Explanation:

3 0
2 years ago
The establishment called ABC Enterprise requires a Java program to keep a database of the inventory of the products that it sell
Alexandra [31]

Answer:

// GetData.java

import javax.swing.JOptionPane;

public class GetData

{

  public static double getDouble(String s)

  {

      return Double.parseDouble(getWord(s));

  }

  public static int getInt(String s)

  {

      return Integer.parseInt(getWord(s));

  }

  public static String getWord(String s)

  {

      return JOptionPane.showInputDialog(s);

  }

  public static String getString(String s)

  {

      return JOptionPane.showInputDialog(s);

  }

}

// Address.java

public class Address

{

  private String street, city, state, zip;

  public Address(String str, String city, String st, String zip)

  {

      street = str;

      this.city = city;

      state = st;

      this.zip = zip;

  }

  public String getStreet()

  {

      return street;

  }

 

  public String getCity()

  {

      return city;

  }

  public String getState()

  {

      return state;

  }

  public String getZip()

  {

      return zip;

  }

}

// Manufacturer.java

public class Manufacturer

{

  private String companyName;

  private Address companyAddress;

 

  public Manufacturer()

  {

      this.companyName = "";

      this.companyAddress = null;

  }

 

  public Manufacturer(String compName, Address address)

  {

      this.companyName = compName;

      this.companyAddress = address;

  }

 

  public String getCompanyName()

  {

      return companyName;

  }

 

  public void setCompanyName(String companyName)

  {

      this.companyName = companyName;

  }

 

  public Address getCompanyAddress()

  {

      return companyAddress;

  }

 

  public void setCompanyAddress(Address address)

  {

      this.companyAddress = address;

  }

}

// Product.java

import java.text.SimpleDateFormat;

import java.util.Date;

public class Product

{

 

  SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");

 

 

  Manufacturer manufacture;

 

 

  String productName;

 

 

  int quantity;

 

 

  double unitPrice;

 

 

  Date productCreated;

 

 

  public Product()

  {

      this.productName = "";

      this.quantity = 0;

      this.unitPrice = 0.0;

      this.productCreated = null;

      this.manufacture = null;

  }

 

  public Product(String prodName, int quantity, double unitPrice,

                        Date productCreated, Manufacturer manufact)

  {

      this.productName = prodName;

      this.quantity = quantity;

      this.unitPrice = unitPrice;

      this.productCreated = productCreated;

      this.manufacture = manufact;

  }

 

 

  public Date getProductCreated()

  {

      return productCreated;

  }

 

 

  public void setProductCreated(Date productCreated)

  {

      this.productCreated = productCreated;

  }

 

  // to get the Manufacturer object

  public Manufacturer getManufacture()

  {

      return manufacture;

  }

 

  // to set the Manufacturer object

  public void setManufacture(Manufacturer manufacture)

  {

      this.manufacture = manufacture;

  }

 

  // to get the name of the product

  public String getProductName()

  {

      return productName;

  }

 

  // to set the name of the product

  public void setProductName(String prodName)

  {

      this.productName = prodName;

  }

 

  // to get the quantity of the product

  public int getQuantity()

  {

      return quantity;

  }

 

  // to set the quantity of the product

  public void setQuantity(int quantity)

  {

      this.quantity = quantity;

  }

 

  // to get the unit price of the product

  public double getUnitPrice()

  {

      return unitPrice;

  }

 

  // to set the unit price of product

  public void setUnitPrice(double unitPrice)

  {

      this.unitPrice = unitPrice;

  }

 

  // to update the quantity of the product

  public void upDateQuantity(int quantity_upDate)

  {

      quantity += quantity_upDate;

  }

 

  // to update the price of the product

  public void upDatePrice(double price_upDate)

  {

      this.unitPrice = price_upDate;

  }

 

 

  public String getProductInfomation()

  {

      String result = "";

      result += String.format("%-30s", productName);

      String dateForm = sdf.format(productCreated);

      result += String.format("\t %s", dateForm);

      result += String.format("%10d", quantity);

      result += String.format("\t%15.2f", unitPrice);

      result += String.format("\t%15s",

                          manufacture.getCompanyName());

      result += String.format("\t%20s",

                 manufacture.getCompanyAddress().getState());

      return result;

  }  

}

Explanation:

  • Create a manufacturer class to store and get information about company name and company address.
  • Create a product class to hold the manufacturer object, product name and other relevant information.
4 0
1 year ago
Other questions:
  • Lucas put a lot of thought into the design for his company's new white paper. He made sure to include repeating design elements
    13·2 answers
  • Open this link after reading about Ana's situation. Complete each sentence using the drop-downs. Ana would need a minimum of ato
    5·2 answers
  • 4.2.3: Basic while loop expression. Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Fol
    6·2 answers
  • In your own words, what is pair-programming? What is the role of the driver? What is the role of the navigator? What are some be
    15·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    15·1 answer
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • Danielle, a help desk technician, receives a call from a client. In a panic, he explains that he was using the Internet to resea
    9·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • Assume that k corresponds to register $s0, n corresponds to register $s2 and the base of the array v is in $s1. What is the MIPS
    10·1 answer
  • A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!