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
Softa [21]
3 years ago
14

For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n

o spaces). Ex: If keysList = {32, 105, 101, 35} and itemsList = {10, 20, 30, 40}, print: 20;30;
Computers and Technology
2 answers:
nika2105 [10]3 years ago
6 0

Answer:

Below are the python Program for the above question:

Explanation:

keysList =[1,61,68,64]#key list items.

itemsList =[1,2,3,4]#item list items.

for x in range(len(keysList)):#for loop.

   if(keysList[x]>60):#check the value to be greator.

       print(itemsList[x],end=";")#print the value.

Output:

  • The above code will print as "2;3;4;".

Code Explanation:

  • The above code is in python language, in which the first and second line of the code defines a list. That list can be changed by the user when he wants.
  • Then there is a or loop that scans the keylist items and matches the items that it is greater than 60 or not. If it then takes the location and prints the itemlist by the help of that location.
RSB [31]3 years ago
4 0

Answer:

Following are the program in Java language

import java.util.Scanner;  // import package

class Main  // main class

{

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

{

int k=0; // variable declaration // declaration of variable  

final int size = 4;  // declared the constant variable  

int[] keysList = new int[size];  // declared the array of keysList

int[] itemsList = new int[size];  // // declared the array of itemsList

keysList[0] = 32;  // storing the value in KeysList

keysList[1] = 105;  // storing the value in KeysList

keysList[2] =101;  // storing the value in KeysList

keysList[3] = 35; // storing the value in KeysList

itemsList[0] = 10; // storing the value in itemList

itemsList[1] = 20; // storing the value in itemLis

itemsList[2] = 30; // storing the value in itemLis

itemsList[3] = 40; // storing the value in itemLis

while(k<itemsList.length)  // iterating the loop

{

if(keysList[k]>60)  // check the condition

{

System.out.print(itemsList[k]);  // display the value

System.out.print(";");    //print space

}

k++;  // increment of k by 1

}

}

Output:

20;30;

Explanation:

Following are the description of Program

  • Create a variable "k" and Initialized with "0".
  • Declared a constant variable "size" with the value 4.
  • Declared the array  "keysList"  and " itemsList" also their value will be initialized.
  • After that iterating the while loop and check the condition of keysList array with a value greater than 60 then display the corresponding value in itemsList.
You might be interested in
The following code should take a number as input, multiply it by 8, and print the result. In line 2 of the code below, the * sym
Juli2301 [7.4K]

Answer:

num = int(input("enter a number:"))

print(num * 8)

Explanation:

num is just a variable could be named anything you want.

if code was like this num = input("enter a number:")

and do a print(num * 8)

we get an error because whatever the user puts in input comes out a string.

we cast int() around our input() function to convert from string to integer.

therefore: num = int(input("enter a number:"))

will allow us to do  print(num * 8)

6 0
3 years ago
________ use statistics to anticipate customers withdrawals. ________ use statistic to calculate probable life expectancy to hel
Fudgin [204]

Answer:

Banks

Insurance companies

Explanation:

3 0
2 years ago
Write the SQL statements that define the relational schema (tables)for this database. Assume that person_id, play_id, birth_year
Sunny_sXe [5.5K]

Answer:

  • SQL statement that defines table for Actor

CREATE TABLE Actor(

person_id integer primary key,

name varchar2(40) not null,

birth_year integer check ((birth_year) <= 2019)

);

  • SQL statement that defines table for Play

CREATE TABLE Play(

play_id integer primary key,

title varchar2(60) not null,

author varchar2(60) not null,

year_written integer check ((year_written) <= 2019)

);

  • SQL statement that defines table for Role

CREATE TABLE Role (

person_id integer,

character_name varchar2(60) not null,

play_id integer,

constraint fk_person foreign key (person_id) references actor(person_id),

constraint fk_play foreign key (play_id) references play(play_id),

primary key (person_id, character_name, play_id)

);

Explanation:

Other information that were not added to the question are as below:

The following database contains information about three tables i.e. actors, plays, and roles they performed.

Actor (person_id, name, birth_year)

Play (play_id, title, author, year_written)

Role (person_id, character_name, play_id)

Where: Actor is a table of actors, their names, and the year they were born. Each actor has a unique person_id, which is a key.

Play is a table of plays, giving the title, author, and year written for each play. Each play has a unique play_id, which is a key.

Role records which actors have performed which roles (characters) in which plays.

Attributes person_id and play_id are foreign keys to Actor and Play respectively.

All three attributes make up the key since it is possible for a single actor to play more than one character in the same play

Further Explanation:

In SQL, in order to define relational schema (Tables) for a database, we use CREATE TABLE statement to create a new table in a database.  The column parameters specify the names of the columns of the table.  The datatype parameter specifies the type of data the column can hold (varchar, integer, date)

4 0
3 years ago
How to code for a database?​
olganol [36]

Answer: <em><u> How to code for a database?​ A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques. </u></em>

WWW. Wikipedia.com

Explanation: When creating a database first you need to make a software program then you need to start planing on what to do ...

{ A database management program (DBMS) is a software package design designed to manipulate, define, retrieve, and manage data in database.

A DBMS generally manipulates the data itself, the the data format, field names, record structure and file structure.}

<h3><u><em>HoPe ThIs HeLpS YoU!!</em></u></h3>

<u><em /></u>

7 0
2 years ago
Can you help please.
liberstina [14]
1. true
2.false
3.true
4. many - I'm not too certain of this answer
5. track changes
3 0
2 years ago
Other questions:
  • What is Least effective at preventing a computer virus
    10·1 answer
  • What is TCP/IP's Transport layer's primary duty?
    8·1 answer
  • You need to find out how much ram is installed in a system. what command do you execute to launch the system information utility
    12·1 answer
  • In the United States, everyone is guaranteed work true or false
    13·1 answer
  • For questions 19 - 21, assume that Student, Employee and Retired are all subclasses of Person, and all four classes have differe
    9·1 answer
  • Which are examples of non-linear presentations? Choose all that apply.
    11·1 answer
  • Each object in your database application is shown in the
    12·1 answer
  • Will, there be any presents this year
    15·1 answer
  • A leading global vendor Of computer software hardware for computer mobile and gaming systems and cloud services it's corporate h
    14·1 answer
  • 30 POINTS PLS HELLLLPPP WILL GIVE BRAINLIEST What behavior do elements in a stack follow? first in, last out, or FILO behavior l
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!