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
wariber [46]
3 years ago
14

5.20 LAB: Output values below an amount Write a program that first gets a list of integers from input. The input begins with an

integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50,60,75,
Computers and Technology
1 answer:
Sveta_85 [38]3 years ago
6 0

Answer:

Following are the code to the given question:

x= input()#defining a variable x that inputs value from the user-end

l = x.split(" ")#defining variable l that splits the x variable value with a space

t= int(l[len(l)- 1])#defining a variable t that decrease the l length and convert the value into integer

for i in range(1, (len(l) - 1)):#use for loop to calculate the range of the list

      if int(l[i]) < t:#defining if block that checks the list value is lessthan t

          print(l[i])#print list values

Output:

Please find the attached file.

Explanation:

In the above-given code, an "x" variable is declared that inputs the value from the user-end, and use the "l" variable that splits all the value and defined a "t" variable that adds value into the list and convert the value into an integer.

In the next step, for loop is declared that counts the lists and use a conditional statement that checks list value is less than t and use the print the method that prints the list values.  

You might be interested in
What is ‘situational awareness” in game design?please answer in a full sentence!
oksano4ka [1.4K]

Situational Awareness in Game Design means;

A state of being aware of happening around the main character or other characters in the game

<h3>Understanding Situational Awareness</h3>

Situational awareness is defined as a state of being aware of the events and activities that are going on around you in regards to where you are, where you are meant to be, and whether anyone or anything around you is a threat to your health and safety.

This ability of situational awareness is very crucial to avoid negative impact and prevent aggravating the situation.

Read more about Situational Awareness at; brainly.com/question/15574042

5 0
2 years ago
In a(n) ____, the programmer uses a programming language (in context free grammar) to tell the computer what to accomplish and h
Mamont248 [21]

A 5GL fifth-generation languages a programming language design to solve given problem without programmer. The user only needs to solve the problem and condition without implementing an algorithm.

Explanation:

First Generation Language

The first generation language is called low- level style because they were used at a superficial level of abstraction. First-generation language referred to as the native language.

Second Generation Language

The second-generation language is also low-level language or assembly language. The second level of language uses the concept of mnemonics for the writing program. Symbolic name are used.

Third Generation Language

The third-generation language overcomes the first and second-generation languages. Third generation language is considered as high- level language because the target is to focus on the logic of the program.

Fourth Generation Language

The language of generation required a lot of time and effort that affect programmers.The fourth-generation was developed to reduce the time, cost, and effort.

Fifth Generation Language

The programming language of this generation focuses on constraints programming. The fifth-generation programming languages are Artificial Intelligence and Artificial Neural Network.

6 0
3 years ago
Develop a C# console application that will determine the gross pay for each of three employees. The company pays straight time f
I am Lyosha [343]

Answer:

The c# program for the scenario is shown.

using System;

class main {

 static void Main() {

   

// arrays to hold details of employees are declared

// double datatype is taken to accommodate all types of numerical values  

     int[] empid = new int[3];

     double[] hours = new double[3];

     double[] pay = new double[3];

     double[] pay_overtime = new double[3];

     double hrs = 40.00;

     double[] total_pay = new double[3];

     

   Console.WriteLine("Enter the details for the three employees ");

// variable declared and initialized for the loop    

   int i=0;

   while(i<3)

   {

       Console.WriteLine("Enter the id");

       empid[i] = Convert.ToInt32(Console.ReadLine());  

       

       Console.WriteLine("Enter the working hours");

       hours[i] = Double.Parse(Console.ReadLine());

       

       Console.WriteLine("Enter the hourly pay");

       pay[i] = Double.Parse(Console.ReadLine());

       pay_overtime[i] = pay[i]*1.5;

       

       i++;

       

   }

   

   Console.WriteLine("The details for the three employees ");

   // variable set to 0 to be re-used in the loop

   i=0;

   

   while(i<3)

   {

       if(hours[i] > hrs)

           total_pay[i] = ( hrs*pay[i] );

       else

           total_pay[i] = ( hours[i]*pay[i] );

       

       if(hours[i] > hrs)

           total_pay[i] = total_pay[i] + ( (hours[i]-hrs)*pay_overtime[i] );

       

       i++;

       

   }

// variable set to 0 to be re-used in the loop

   i=0;

   

   while(i<3)

   {

       Console.WriteLine("Gross pay of employee " + (i+1) + " : " + total_pay[i] );

   

       i++;

   }

   

   

 }

}  

OUTPUT

Enter the details for the three employees  

Enter the id

1

Enter the working hours

35

Enter the hourly pay

10

Enter the id

2

Enter the working hours

40

Enter the hourly pay

10

Enter the id

3

Enter the working hours

45

Enter the hourly pay

10

The details for the three employees  

Gross pay of employee 1 : 350

Gross pay of employee 2 : 400

Gross pay of employee 3 : 475  

Explanation:

The program works as described.

1. Arrays to hold each piece of information for the employee, employee number, hourly pay, overtime pay and hours worked, are declared.

2. User input is taken inside while loop to fill each array for each employee.

3. The total gross pay for each employee is calculated inside another while loop.

4. The last while loop is used to display the gross pay for each employee.

3 0
3 years ago
Below you will find the requirements to identify the Account Diversity Grade of a user. Read the requirements carefully and iden
igomit [66]

The technique I used to test the requirement is equivalence partitioning.

<h3>Equivalence Partitioning-</h3>

Generic test data is considered where all the test data satisfies the conditions provided in the problem. Such that,

- ADGrade A --> TA=25 LC=5

- ADGrade B --> TA=20, LC=3

- ADGrade C --> TA=8 LC=2

- ADGrade D --> TA=2, LC=1

- ADGrade null (n/a)—> TA=0, LC=0

Where:

  • TA represents totalAccounts,
  • LC represents loanTypeCount,
  • ADGrade represents accountDiversityGrade

If we are to combine the test data collected above, we would obtain the entire set of test data.

With this in mind, the minimum number of users that are required for testing the requirement is 5.

Read more about requirement testing here:

brainly.com/question/16147055

#SPJ1

8 0
1 year ago
. Briefly describe an SQL DML statement for storing new data into a table.
STatiana [176]

DML stands for Data Manipulation Language.

SQL DML statements consist of insert, update and delete statements.

Out of these three, insert is used to add new data to the table.

The update command modifies the existing data in the given table.

The delete command removes the data from the given table.

Syntax

INSERT INTO table_name ( column1, column2, …….. )

VALUES ( value1, value2, ……… )

The table_name represents the table in which data is to be inserted.

All the columns in the table_name need to be specified in the brackets in the insert into clause.

All the values in the values clause should correspond to the columns, both in the order in which the columns are mentioned and the data type of the values should match the respective column.

Example

Consider the table Person consisting of columns id, name, gender having data type integer, varchar and varchar, respectively.

In order to add data to all the columns of the Person table, the command is as follows.

Insert into Person ( id, name, gender )

Values ( 101, “Alexis”, “Male” );

In the above command, value is present for each column in the respective order. Also, the format of the data match the format of the columns.

Other versions of the insert command add data only to some columns in the table.

Insert into Person ( id, name )

Values ( 102, “Aayesha” );

The above command adds data only to two columns as mentioned.

Also, null value can be added using insert command.

Insert into Person ( id, name, gender )

Values ( 103, “Brainly dot com”, null );

Since null value appears at number three, the corresponding column to this value is also number three, i.e., gender column.

This inserts null value as the gender for Brainly dot com.

3 0
3 years ago
Other questions:
  • What is an example of hardware
    13·2 answers
  • A range check that can be used in Microsoft access to calculate the data collected which is date and time
    10·1 answer
  • 4. Use the information under the Nutrients That the Human Body Needs title to create a multilevel list. Your list should meet th
    8·2 answers
  • The movie polar express was critically acclaimed due to the unbelievably lifelike movements of Tom Hanks character
    13·1 answer
  • What is another word for: a location in memory that contains a value?
    7·2 answers
  • Which of these describes, in increasing order, the file sizes of the same image in different formats? Group of answer choices
    6·1 answer
  • (Language: Python) How can you know what value is in a variable by looking at the code?
    14·1 answer
  • Sort the layout options for two types of masters in PowerPoint.
    5·1 answer
  • A. Modify the FitnessTracker class that includes data fields for a fitness activity, the number of minutes spent participating,
    12·1 answer
  • __________ is a software-enabled technique that can change the hardcoded mac address to any mac address and thus overcome mac ad
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!