Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should NOT be added to the list). These values entered by the user are added to a list we call 'initial_list'. Then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. Finally, inside main(), print out all of the values in the new list.

Answers

Answer 1

Answer:

def create_3_copies(initial_list):

   another_list = []

   

   for i in range(3):

       for x in initial_list:

           another_list.append(x)

   return another_list

   

initial_list = []

while True:

   value = input("Enter a value: ")

   if value == "exit":

       break

       

   initial_list.append(value)

for x in create_3_copies(initial_list):

    print(x, end=" ")

Explanation:

Create a function that takes initial_list as parameter. Inside the function:

Create an empty list called another_list

Create a nested for loop. The outer loop iterates 3 times (Since we need to add every value 3 times). The inner loop iterates through the another_list and adds each value to the another_list.

When the loops are done, return the another_list

In the main:

Create an empty list named initial_list

Create an indefinite while loop. Inside the loop, ask the user to enter a value. If the value equals "exit", stop the loop. Otherwise, add the value to the initial_list

Create another for loop that calls the function we created passing the initial list as a parameter and iterates through the values that it returns. Inside the loop, print each value


Related Questions

The Westfield Carpet Company has asked you to write an application that calculates the price of carpeting for rectangular rooms. To calculate the price, you multiply the area of the floor (width times length) by the price per square foot of carpet. For example, the area of floor that is 12 feet long and 10 feet wide is 120 square feet. To cover that floor with carpet that costs $8 per square foot would cost $960. (12 × 10 × 8 = 960.) First, you should create a class named RoomDimension that has two FeetInches objects as attributes: one for the length of the room and one for the width. (You should use the version of the FeetInches class that you created in Programming Challenge 11 with the addition of a multiply member function. You can use this function to calculate the area of the room.) The RoomDimension class should have a member function that returns the area of the room as a FeetInches object. Next, you should create a RoomCarpet class that has a RoomDimension object as an attribute. It should also have an attribute for the cost of the carpet per square foot. The RoomCarpet class should have a member function that returns the total cost of the carpet. Once you have written these classes, use them in an application that asks the user to enter the dimensions of a room and the price per square foot of the desired carpeting. The application should display the total cost of the carpet.

Answers

Answer:

Answered below

Explanation:

#program is written in Java

class RoomDimension{

double length;

double width;

RoomDimension (double length, double width){

this.length = length;

this.width = width;

}

public double roomArea ( ){

return length * width;

}

}

class RoomCarpet{

RoomDimension rd;

double price;

RoomCarpet ( RoomDimension rd, double price){

this.rd = rd;

this.price = price;

}

public double totalCost( ){

double area = rd.roomArea();

return area * price;

}

}

While the Internet is used to share many useful services and information, there are growing concerns about the way that the Internet can be used to spread damaging information ranging from national secrets to calls for violence. Censoring this information may provide some people with increased security, but potentially risks free speech and the safety of social and political activists.

a. True
b. False

Answers

Answer:

A true!

Explanation:

In 2019, the tuition for a full time student is $7,180 per semester. The tuition will be going up for the next 7 years at a rate of 3.5% per year. Write your program using a loop that displays the projected semester tuition for the next 7 years. You may NOT hard code each years tuition into your program. Your program should calculate the tuition for each year given the starting tuition in 2019 ($7, 180) and the rate of increase (3.5%). You should then display the actual year (2020, 2021, through 2026) and the tuition amount per semester for that year

Answers

Answer:

In Python:

tuition = 7180

year = 2019

rate = 0.035

for i in range(2019,2027):

   print(str(year)+": "+str(round(tuition,2)))

   tuition = tuition * (1 + rate)

   year = year + 1

   

Explanation:

This initializes the tuition to 7180

tuition = 7180

This initializes the year to 2019

year = 2019

This initializes the rate to 3.5%

rate = 0.035

This iterates through years 2019 to 2026

for i in range(2019,2027):

This prints the year and tuition

   print(str(year)+": "+str(round(tuition,2)))

This calculates the tuition

   tuition = tuition * (1 + rate)

This increments year by 1

   year = year + 1

If Mark has a read-write permission to the share \\fileserver\securefiles and a read-only permission to the file coolstuff.docx on the NTFS file system shared by the file share, he is able to perform which action?

a. Rename the file.
b. Read the file.
c. Change the contents of the file.
d. Delete the file.

Answers

Answer:

I don't know  you should figure that out good luck

Explanation:

good luck

How many digits are there in a decimal system

Answers

Answer:

10

Explanation:

Answer:

4

Explanation:

Tenth , hundredth , thousandths , tenthousanths

What are the characteristics of Instant Search in Outlook 2016? Check all that apply. A)Typing whole phrases makes your search more efficient.
B)An Instant Search box appears in every view in Outlook.
C)Instant Search can be found under the Search tab in Outlook.
D)After typing one word, it immediately begins displaying results.
E)The Search contextual tab appears when Instant Search is selected.

Answers

Answer:

B, D, and E.

Explanation:

Answer:

B,D,E

Explanation:

Edg 2021 just took test

Consider the following code segment, which is intended to simulate a random process. The code is intended to set the value of the variable event to exactly one of the values 1, 2, or 3, depending on the probability of an event occurring. The value of event should be set to 1 if the probability is 70 percent or less. The value of event should be set to 2 if the probability is greater than 70 percent but no more than 80 percent. The value of event should be set to 3 if the probability is greater than 80 percent. The variable randomNumber is used to simulate the probability of the event occurring.
int event = 0;
if (randomNumber <= 0.70)
{
event = 1;
}
if (randomNumber <= 0.80)
{
event = 2;
}
else
{
event = 3;
}
The code does not work as intended. Assume that the variable randomNumber has been properly declared and initialized. Which of the following initializations for randomNumber will demonstrate that the code segment will not work as intended?
A) randomNumber = 0.70;
B) randomNumber = 0.80;
C) randomNumber = 0.85;
D) randomNumber = 0.90;
E) randomNumber = 1.00;

Answers

Answer:

A) randomNumber = 0.70;

Explanation:

The code works perfectly for all values of randomNumber given in the options except option (a)

This is so because:

The first condition

if (randomNumber <= 0.70)  {  event = 1;  }

It checks if randomNumber is less than or equal to 0.70. This is true, so event is set to 1.

However, the next condition after it will also be executed because it is a different conditional to be executed.

So, we have:

if (randomNumber <= 0.80)  {  event = 2;  }

This condition is also true, so event is set to 2.

From the question randomNumber is meant to be event 1. However, this is different from the result of executing the code.

Hence, (a) is true

Under the Gramm-Leach-Bliley-Act (GLBA), banks must protect customer privacy. A given bank has just implemented its online banking solution that allows customers to access their accounts and perform transactions via their computers or personal digital assistant (PDA) devices. Online banking servers and their public Internet hosting would fall within which domains of security responsibility?

Answers

Answer:

System/Application Domain and LAN-to-WAN Domain.

Explanation:

The Gramm-Leach-Bliley-Act is also referred to as the Financial Services Modernization Act of 1999. It was enacted by the 106th Congress of the United States of America and it requires that financial institutions explain to their customers the information sharing policies and ensure that customer sensitive data (privacy) is safeguarded.

This, under the Gramm-Leach-Bliley-Act (GLBA), banks must protect customer privacy.

In this scenario, a given bank has just implemented its online banking solution that allows customers to access their accounts and perform transactions via their computers or personal digital assistant (PDA) devices.

Hence, online banking servers and their public Internet hosting would fall within the System/Application Domain and LAN-to-WAN Domain.

In an IT infrastructure, there are seven main domains and these are the: User Domain, Workstation Domain, LAN Domain, LAN-to-WAN Domain, Remote Access Domain, WAN Domain, and System/Application.

what are layers in Photoshop ​

Answers

Answer:

Photoshop layers are like stacked pieces of stacked acetate. You can see through some parts because they are transparent. You can use layers to add on to your picture easily like adding extra images, text, or colors.

8.11 LAB: Contact list (C++)









A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name.


Ex: If the input is:


3 Joe 123-5432 Linda 983-4123 Frank 867-5309

Frank

the output is:


867-5309


Your program must define and call the following function. The return value of GetPhoneNumber is the phone number associated with the specific contact name.

string GetPhoneNumber(vector nameVec, vector phoneNumberVec, string contactName)


Hint: Use two vectors: One for the string names, and the other for the string phone numbers.

Answers

Answer:

The vectors and phone numbers are 123-5432-983-4123-867-5309

Explanation:

How many digits are in the binary number system? Explain why.

Answers

Answer:

Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication: If the digit in B is 0, the partial product is also 0. If the digit in B is 1, the partial product is equal to A.

Explanation:

Answer:

two digits

Explanation:

Binary – The binary numbering system has a base of 2 (MOD-2) and uses only two digits a “0” and a “1” to represent a binary number value.

how can you best explain server side caching with web pages​

Answers

Answer:

Server side web caching typically involves utilizing a web proxy which retains web responses from the web servers it sits in front of, effectively reducing their load and latency.

Explanation:

In this lab, you use the flowchart and pseudocode found in the figures below to add code to a partially created C++ program. When completed, college admissions officers should be able to use the C++ program to determine whether to accept or reject a student, based on his or her test score and class rank.
start input testScore,
classRank if testScore >= 90 then if classRank >= 25 then output "Accept"
else output "Reject" endif else if testScore >= 80
then if classRank >= 50 then output "Accept" else output "Reject" endif
else if testScore >= 70
then if classRank >= 75 then output "Accept"
else output "Reject"
endif else output "Reject"
endif
endif
endif
stop
Study the pseudocode in picture above. Write the interactive input statements to retrieve: A student’s test score (testScore) A student's class rank (classRank) The rest of the program is written for you. Execute the program by clicking "Run Code." Enter 87 for the test score and 60 for the class rank. Execute the program by entering 60 for the test score and 87 for the class rank.
[comment]: <> (3. Write the statements to convert the string representation of a student’s test score and class rank to the integer data type (testScore and classRank, respectively).)
Function: This program determines if a student will be admitted or rejected. Input: Interactive Output: Accept or Reject
*/ #include using namespace std; int main()
{ // Declare variables
// Prompt for and get user input
// Test using admission requirements and print Accept or Reject
if(testScore >= 90)
{ if(classRank >= 25)
{ cout << "Accept" << endl; }
else
cout << "Reject" << endl; }
else { if(testScore >= 80)
{ if(classRank >= 50)
cout << "Accept" << endl;
else cout << "Reject" << endl; }
else { if(testScore >= 70)
{ if(classRank >=75) cout << "Accept" << endl;
else cout << "Reject" << endl; }
else cout << "Reject" << endl; } } } //End of main() function

Answers

Answer:

The equivalent program in C++:

#include<iostream>

#include <sstream>

using namespace std;

int main(){

   string Score, Rank;

   cout<<"Enter student score and class rank: ";

   cin>>Score>>Rank;

   int testScore = 0, classRank = 0;

   stringstream sstream(Score);

   sstream>>testScore;

   

   stringstream tream(Rank);

   tream>>classRank;

   

   if (testScore >= 90){

       if(classRank >=25){cout<<"Accept";}

       else{cout<<"Reject";}

   }

   else if(testScore >= 80){

       if(classRank >=50){cout<<"Accept";}

       else{cout<<"Reject";}

   }

   else if(testScore >= 70){

       if(classRank >=75){cout<<"Accept";}

       else{cout<<"Reject";}

   }

   else{cout<<"Reject";}

   return 0;

}

Explanation:

This declares Score and Rank as string variables

   string Score, Rank;

This prompts the user for score and class rank

   cout<<"Enter student score and class rank: ";

This gets the user input

   cin>>Score>>Rank;

This declarees testScore and classRank as integer; and also initializes them to 0

   int testScore = 0, classRank = 0;

The following converts string Score to integer testScore

   stringstream sstream(Score);

   sstream>>testScore;

The following converts string Rank to integer classRank

   stringstream tream(Rank);

   tream>>classRank;

The following conditions implement the conditions as given in the question.    

If testScore >= 90

   if (testScore >= 90){

If classRank >=25

       if(classRank >=25){cout<<"Accept";}

If otherwise

       else{cout<<"Reject";}

   } ---

If testScore >= 80

   else if(testScore >= 80){

If classRank >=50

       if(classRank >=50){cout<<"Accept";}

If otherwise

       else{cout<<"Reject";}

   }

If testScore >= 70

   else if(testScore >= 70){

If classRank >=75

       if(classRank >=75){cout<<"Accept";}

If otherwise

       else{cout<<"Reject";}

   }

For testScore less than 70

   else{cout<<"Reject";}

What is the major difference between the intranet and extranet?
Question 36 options:

Intranets hold more importance

The major difference between the two, however, is that an intranet is typically used internally.

Extranets improve internal communications

None of the above

Answers

Explanation:

The major difference between the two, however, is that an intranet is typically used internally.

The major difference between the intranet and extranet is that The major difference between the two, however, is that an intranet is typically used internally.

What is an Intranet?

Traditionally, an intranet is the concept of as a non-public and confined inner Web-primarily based totally web website online and/or community this is best handy to customers inside an organization.

An intranet is a non-public community contained inside an agency this is used to soundly proportion business enterprise facts and computing assets amongst employees. An intranet also can be used for operating in corporations and teleconferences. Intranets inspire communique inside an organization.

Read more about the communications:

https://brainly.com/question/26152499

#SPJ2

A header is printed in the _____ margin
(1)Top
(2)Bottom
(3)Side
(4)both a and b ​

Answers

Answer:

(1)Top

Explanation:

Bcoz it is header

A header can be printed on the top margin.

What is a header?

A part of a text in the line that is generally used to describe the title or the topic of the text contained below such line is known as a header. It is represented in the top margin, as a title can be written on the bottom side.

Hence, option A holds true regarding a header.

Learn more about a header here:

https://brainly.com/question/15163026

#SPJ2

Word processing package allow users to?

Answers

Explanation:

allows users to create, edit, and print documents. It enables you to write text, store it electronically, display it on a screen, modify it by entering commands and characters from the keyboard, and print it. 

7 steps in infographic design​

Answers

Answer:

Step 1: Choose your topic and research your audience. Before looking at your data, think about a topic and an audience with whom it can resonate.  

Step 2: Take a look at your data and consolidate it.  

Step 3: Craft the copy.  

Step 4: Design!  

Step 5: Review, review, review.

Step 6: Publish and promote.  

Conclusion.

Explanation:

Process infographics are a specific type of infographic, designed to visualize, summarize and simplify processes. They're perfect for visualizing marketing strategies, new employee onboarding, customer journey maps, product guides, recipes and more.

true or false Encryption prevents hackers from hacking data?

Answers

Answer:

The answer here is False.

Explanation:

Encryption protects the data and not access to data.

In some cases, the hacker may not necessarily be trying to access or decrypt the data. They may prevent one from accessing it by placing a Ransomeware virus on it.

What a Ransomeware virus would do is to prevent the legal and rightful owner from accessing such data (whether encrypted or not) until their demands are met.

In many cases, they would ask for monies or cryptocurrencies.

Another way hackers attempt to get encrypted files is to try to get the decryption keys instead. The best practice against this is to keep decryption keys manually or in a password manager. Another way to protect very sensitive information is to have sensitive systems isolated from the internet.

Cheers

What can you use to make sure that you have no errors in Word Online?

Answers

Answer:

You can use grammarly. It woks amazingly!

Explanation:

Extend the functionality of cout by implementing a friend function in Number.cpp that overloads the insertion operator. The overloaded insertion operator returns an output stream containing a string representation of a Number object. The string should be in the format "The value is yourNum", where yourNum is the value of the integer instance field of the Number class.Hint: the declaration of the friend function is provided in Number.h.Ex: if the value of yourNum is 723, then the output is:

Answers

Answer:

// In the number.cpp file;

#include "Number.h"

#include <iostream>

using namespace std;

Number::Number(int number)

{

   num = number;

}

void Number::SetNum(int number)

{

   num = number;

}

int Number::GetNum()

{

   return num;

}

ostream &operator<<(ostream &out, const Number &n)

{

   out << "The value is " << n.num << endl;

   return out;

}

// in the main.cpp file;

#include "Number.cpp"

#include <iostream>

using namespace std;

int main()

{

   int input;

   cin >> input;

   Number num = Number(input);

   cout << num;  

   return 0;

}

Explanation:

The main function in the main.cpp file prompts the user for the integer value to be displayed. The Number file contains defined functions and methods of the number class to set, get and display the "num" variable.

Which family of controls included in the risk management Infrastructure is related to preventing the use of unauthorized codes?​

Answers

Answer:

Operational Security Control

Explanation:

The family of controls included in the risk management Infrastructure that is related to preventing the use of unauthorized codes is known as "Operational Security Control."

This is because Operational Security Control defines potency of controls which involves the access controls, including the use of unauthorized codes, authentication, and security measures made to networks, systems, and applications.

Answer:

system and information integrity

Explanation:

i got a 100 on the test

Create a relational database table in Microsoft Excel for the grocery store of 20 employers.

Answers

Answer:

That is not a question.

Explanation:

Master method/theorem can be used to find the running time of all recursive programs.

a. True
b. False

Answers

it should be a. true

Which tab of the ribbon should you go to for removing gridlines on a worksheet?​

Answers

Answer:

just click on the option gridline

You should go to the Page Layout tab of the ribbon to remove gridlines on a worksheet.

This tab hold all the features and options that can enable you to arrange your documents as you want them to appear.

It can help you to do the following:

set marginstake control of the page orientationDisplay line breaksAdd sectionsSet paragraphs and also indent.

Read more on: https://brainly.com/question/11874395?referrer=searchResults

raman will perform in pune tomorrow(simple past)​

Answers

Answer:

Raman performed in Pune yesterday

Answer:

Raman had performed in Pune

Top-level domain identifies the type of organization. Which one does NOT belong?
Question 4 options:

.gov

.mil

.org

.cn

Answers

Answer:

.cn does Not belong the rest of them do belong

the answer is “.mil”.

1. ERICUS Company sells Ghacem cement at 30.0 Ghana Cedis per bag. The company however gives discount of 15% for customers that buy 100 or more bags, and 0% for customers that buy less than 100 bags. Write a pseudocode.

Answers

See Comment for complete question

Answer:

Input Bags

Discount = 0%

If Bags >= 100 Then

Discount = 15%

End If

Print Discount

Stop

Explanation:

This gets the number of bags bought

Input Bags

This initializes the discount to 0%

Discount = 0%

If the bags of cement bought is 100 or above

If Bags >= 100 Then

This discount becomes 15%

Discount = 15%

This ends the if statment

End If

This prints the discount percentage

Print Discount

This ends the pseudocode

Stop

a technique for printing text images or pattern which originated in china as a method for printing on paper​

Answers

Answer:

Woodblock printing or block printing is a technique for printing text, images or patterns used widely throughout East Asia and originating in China in antiquity as a method of printing on textiles and later paper. As a method of printing on cloth, the earliest surviving examples from China date to before 220 AD.

What is IP address ?explain​

Answers

Answer:

An IP address is a unique address that identifies a device on the internet or a local network. IP stands for "Internet Protocol," which is the set of rules governing the format of data sent via the internet or local network.

Explanation:

IP addresses provide a way of doing so and form an essential part of how the internet works.

Answer: An Internet Protocol address is a number which is unique to. each device connected to the label. It is used for identification and location.  

Explanation:

Java Programming Using nested if statement For a student to be accepted in XYZ College, the student must meet the following requirements: GPA must be 3.75 or higher. Family income must be more than $60,000 Applicant must be a New Jersey resident. XYZ college asked you to write a program to implement the above requirements. Write the program using (nested if) Submit: Source code for the program (java file) Output word or pdf or jpg Design pseudocode pdf or word or jpg

Answers

Answer:

Follows are the solution to this question:

import java.util.*;//import package  

public class Main//defining a class

{

       public static void main(String[] ags)//main method  

       {

       float GPA;//defining floating point variable  

       int annual_income;//defining integer variable

       Scanner ga = new Scanner(System.in);//creating Scanner class object

       System.out.println("Enter GPA of student family : ");//print message

       GPA= ga.nextFloat();//input value from user-end

       System.out.println("Enter annual income of student family : ");//print message

       annual_income= ga.nextInt();//input value from user-end

      System.out.println("Is student resident of New Jersey(y/n) :");//print message

       char a=ga.next().charAt(0);//defining char variable to input char value

if(GPA>=3.75) //use if block to check GPA value

       {

        if(annual_income>60000) // use if to check annual income value

         {

            if((a == 'y'|| a== 'Y')) //use if to check char value

   System.out.println("Student accepted in college");//print message

            else//defining else block

             System.out.println("Student is not accepted in college because he/she not resident of New Jersey ");//print message

         }

        else//defining else block

          System.out.println("Student is not accepted in college because annual income is less than $60000 ");//print message

    }

   else//defining else block

    System.out.println("Student is not accepted in college because GPA is less than 3.75 ");//print message

       }

}

Output:

Please find the attached file.

Explanation:

Please find the attached file of the pseudocode.

In this code one integer, one float, and char variable "GPA, annual_income, and a" is declared, that uses the scanner class for accept value from the user-end, and in the next step, nested if the statement is used that checks the GPA value, annual_income, and a value and use the print method to print a value with the message.

Other Questions
2 pointsThe 5' and 3' numbers arerelated to the *O length of the DNA strandO carbon number in sugarO the number of phosphatesO the base pair rule can someone help with this question please In a recent benefit-cost analysis of a proposed regulation that generated positive net benefits in the present but negative net benefits in the future, the government used a 5% social discount rate. If it had instead used a 7% social discount rate, the net present value of the policy would have been ______; if it had used a 10% social discount rate, the net present value would have been ______. 9. Make Sense and Persevere Write and graphexponential functions to model the numberof students at School A and at School B as afunction of number of years. In about howmany years will the number of students at bothschools be approximately the same? Explainhow you can use a graph to determine theanswerSchool ASchool B240 studentsdecreasing atan awal sale of 2%180 studentsincreasing atan annual rate of 3% What is the ratio of the number of students who sometimes watch sports to the total number of students surveyed? Choose the sentence that uses commas correctly. A.) You can have eggs or cereal or French toast.B.) You can have eggs, or cereal, or French toast.C.) You can have eggs or cereal, or French toast. help pleaseeeeeeee i will give brainlest! A P E XIf each of the numbers in the following data set were multiplied by 18, what would be the new median of the data set? 14, 20, 18, 58, 71, 36 A. 504 B. 360 C. 324 D. 648 1. Succession is best defined at as a ______________ series of changes that occur in an ecosystem over time:a) randomb) predictable c) rapidd) beneficial how many pennies can 4 folds of a paper hold? How does ex situ conservation help in biodiversity conservation? Whats the answer? I want it now! Please? A bike tire just ran over a nail, and it is losing pressure at a rate of 5% every minute. The tire pressure is currently 900 kilopascals. What will it be in 7 minutes? The opposite of 'always' is(i)(ii) neverever(iii) frequent (iv) oftenAns. Andy had some basketball cards. After he bought 12 more, he had 48 cards. How many cards did Andy have at the start? Write an algebraic equation and solve. PLEASE HELP IT"S URGENT How is the live play of 'The Three Little Pigs' different from the written play? Please answer the question in a complete sentence for full creditPLZ HELP How many days will it take a wild horse to travel 2,7002,700 miles if the horse travels 3030 miles a day? Use paper to show your work. why did it upset most southern states and their people when California asked to be annexed as a free state in 1950? Which of the following are inalienable rights according to the Declaration of Independence?A) ability to voteB) happinessC) equalityD) life, liberty, and the pursuit of happiness