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
Jobisdone [24]
4 years ago
9

Write an expression to print each price in stock_prices. Sample output with inputs: 34.62 76.30 85.05

Computers and Technology
1 answer:
Lana71 [14]4 years ago
4 0

Answer:

Here is the Python program:

stock_prices = input().split() #to take input and splits it into a list

for price in stock_prices: #iterates through stock_prices

   print("$",price) #prints each value of stock_prices with a dollar sign

Explanation:

The program is well explained in the attached comments. I will explain the logic of the program with the help of an example:

Suppose the user enters the following input as stock_prices values

34.62 76.30 85.05

input() method is used to take input from user

split() method is used to split or break this input string and returns a list of strings as:

['34.62', '76.30', '85.05']    

Now the statement for price in stock_prices: iterates through each item of the list and print("$",price) prints each value of list with a dollar sign on the output screen as:

$ 34.62                                                                                                            

$ 76.30                                                                                                            

$ 85.05    

You might be interested in
A file that contains program code is called a ____________.
BartSMP [9]
Executable or binary
4 0
3 years ago
Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targe
natali 33 [55]

Answer:

The C++ code is given below with appropriate comments

Explanation:

//Remove this header file if not using visual studio.

#include "stdafx.h"

//Include the required header files.

#include <iostream>

//Use for maths function.

#include <cmath>

using namespace std;

//Define main function

int main()

{

      // Define the variables

      double targetValue = 0.3333;

      double sensorReading = 0.0;

      //Perform the opeartion.

      sensorReading = 1.0 / 3.0;

      // Get the absolute floating point value and

      // Check up to 4 digits.

      if (fabs(sensorReading - targetValue) < 1E-4)

      {

             //Print equal if the values are close enough.

             cout << "Equal" << endl;

      }

      else

      {

             //Print not equal if the values are not                  

             //close enough.

             cout << "Not equal" << endl;

      }

      system("pause");

      //Return the value 0.

      return 0;

}

5 0
4 years ago
Define ROM and list the types of read only memories.
Lorico [155]

Answer:

Read-only memory, also known as ROM, is a storage medium used in computers and electronic devices, which allows only the reading of information and not its writing, regardless of the presence or not of an energy source.

The data stored in the ROM cannot be modified, or at least not quickly or easily. It is mainly used to contain firmware (a program that is closely linked to specific hardware, and is unlikely to require frequent updates) or other vital content for device operation, such as programs that start up the computer and perform diagnostics.

There are three types of ROM memories: PROM. EPROM, and EEPROM.

6 0
3 years ago
The general who directed the project responsible for the "Fat Man” graduated from what alma mater in 1918?
krek1111 [17]
Stafford Leak Warren (July 19, 1896 - July 26, 1981) was an American physician and ... He was responsible<span> for the health and safety of the thousands of personnel ... The medical school had opened in 1925 and did not </span>graduate<span> its first class ... Brigadier</span>General<span> Leslie R. Groves, the director of the Manhattan </span>Project<span> </span>
7 0
4 years ago
Read 2 more answers
There is an interface I that has abstract class AC as its subclass. Class C inherits AC. We know that C delegates to an object o
Aloiza [94]

Answer:

are u in HS or college work

I am trying to understand

6 0
3 years ago
Other questions:
  • In which phase of the design process does the developer establish the project goals? A. Design B. Planning C. Development D. Lea
    15·2 answers
  • Define the term unique key and give an example.
    6·1 answer
  • What is labor and how does it relate to automobile!!!! NEED HELP PLEASEE
    13·1 answer
  • Which of the following Internet access methods involves connecting your phone to an Internet-ready laptop in order to gain acces
    14·2 answers
  • write a Program which displays at least 5 different sentences that explain how technology has been used to win souls to Christ.
    6·1 answer
  • Could someone give an example or tell me what all of these mean? (For internet source citing)
    10·1 answer
  • What feature is not included in most DTP programs?
    9·1 answer
  • Which of the following types of operating systems does Windows® belong to?
    15·1 answer
  • after landing, you are tying down the aircraft when a person approaches and asks: "faa. are you the pilot of this aircraft?" wha
    11·1 answer
  • An optical drive randomly becomes unavailable, and after replacing the drive, the technician now suspects that the drive may not
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!