Questions
Employee_id First_name Last_name Salary Joining_date Department 1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking 2 Michael...

Employee_id

First_name

Last_name

Salary

Joining_date

Department

1

John

Abraham

1000000

01-JAN-13 12.00.00 AM

Banking

2

Michael

Clarke

800000

01-JAN-13 12.00.00 AM

Insurance

3

Roy

Thomas

700000

01-FEB-13 12.00.00 AM

Banking

4

Tom

Jose

600000

01-FEB-13 12.00.00 AM

Insurance

5

Jerry

Pinto

650000

01-FEB-13 12.00.00 AM

Insurance

6

Philip

Mathew

750000

01-JAN-13 12.00.00 AM

Services

7

TestName1

123

650000

01-JAN-13 12.00.00 AM

Services

8

TestName2

Lname%

600000

01-FEB-13 12.00.00 AM

Insurance

Write the following queries:

1. Get all employee details from the employee table

2.Get First_Name from employee table using alias name “Employee Name”, sorted descending

3.Get unique DEPARTMENT from employee table

4.Get employee details from employee table whose employee name are “John” and “Roy”

5.Get employee details from employee table whose employee name are not “John” and “Roy”

6.Get employee details from employee table whose first name contains 'o'

7.Get employee details from employee table whose first name ends with 'n'

8.Get employee details from employee table whose Salary between 500000 and 800000

9.Get employee details from employee table whose name is 'John' and 'Michael'

In: Computer Science

import java.util.LinkedList; import java.util.Queue; import java.time.*; public class CheckOutLine { /** This is the main function...

import java.util.LinkedList;
import java.util.Queue;
import java.time.*;

public class CheckOutLine
{
/** This is the main function for the program */
public static void main()
{
System.out.println("\n\tBegin CheckOutLine Demo\n");

System.out.println("\nCreating a Queue called \"register\" based on a LinkedList");
Queue<Customer> register = new LinkedList<Customer>();
  
System.out.println("\nAdding Customers to the Register queue");
// 1. TO DO: add five or more customers to the register line (5 Pts)
// format: register.add(new Customer(name, checkout time));

  
  
  
  
  
System.out.printf("Register line has %d customers\n", register.size());
  
System.out.println("\nDeclare the LocalTime start time as 10:00");
LocalTime lt = LocalTime.parse("10:00:00.00");
  
System.out.println("Start checking out Customers at the register at " + lt);
// 2. TO DO: code a while loop statement to process all the
// customers in the queue (3 Pts)
while(. . . . . . .)
{
Customer cust = register.poll();
lt = lt.plus(Duration.ofMinutes(cust.getMinutes()));
System.out.println(cust.toString() + " checked out at " + lt);
}

System.out.println("\n\tEnd CheckOutLine Demo\n");
}
}

import java.lang.String;

public class Customer
{
private String name;
private int minutes;

/**
* Constructor for objects of class Customer
* @param name - customer name
* @param minutes - number of minutes to check out at register
*/
public Customer(String name, int minutes)
{
this.name = name;
this.minutes = minutes;
}
  
/**
* This method returns the minutes for check out
* @return minutes - the number of minutes to spend checking out at the register
*/
public int getMinutes()
{
return minutes;
}

/**
* This method overrides the toString method of the Object class
* to return the customer information as a String for display
* @return Customer information as a String
*/
@Override
public String toString()
{
return String.format("%-20s %3d minutes ", name, minutes);
}
}

In: Computer Science

Please make the following changes to the following code: #This program takes in the first and...

Please make the following changes to the following code:

#This program takes in the first and last name and creates a userID printing first letter of first name and first 7 characters of last name
#by Abi Santo
#9/20/20

def main():
    print("This Program takes your first and last name and makes a User ID")
    f_name = str(input("Please enter your first name ")).lower()
    l_name = str(input("Enter your last name: ")).lower()
    userID = str(f_name[:1]+str(l_name[:7]))
    print(userID)

main()
  1. Call the function createUserName(). This function will prompt the user for first and last names, create the userid from the first initial plus the last name, and return the userid to the main() function
  2. main() will print out the userid returned from the createUserName().
  3. main will then call the function createPassword(). This function will prompt the user for a password. It will return the password to main()
  4. The main() function will then call checkFirstCharacter(), passing the first character of the password. CheckFirstCharacter() will check to see if the first character is alphabetic, and return either a True or False value back to main().
  5. If a "True" value is received from checkFirstCharacter (see above), then main() will call  checkRemainingChars(), passing the remainder of the password. checkRemainingChars() will check to see if the remainder of the string is alphabetic or numeric, and return a True or False value back to main().

  6. If either checkFirstChar or checkRemainingChars returns a value of "False", main() will issue an appropriate error message (specific to which was in error), and prompt the user for a new password.

  7. Once the entire password has been validated, main() will print a "Password accepted" message to the user.


please use python

In: Computer Science

C++ using vectors. in the following code, if a user adds duplicate names the votes should...

C++ using vectors.

in the following code, if a user adds duplicate names the votes should be added to only one of the names:

example

display "Enter candidate name: "

input john

display "Enter candidate vote:"

input 10

display "Enter candidate name: "

input john

display "Enter candidate vote:"

input 10

so the output has to be

john with 20 votes.

#include<iostream>

#include<iterator>

#include<string>

#include<algorithm>

#include<array>

#include<ctime>

#include <vector>

#include<bits/stdc++.h>

using namespace std;

int max_element(const vector<int>&stuff)

{

int max_index =0;

for (int i=1; i<stuff.size();++i)

if (stuff[i]>stuff[max_index])

max_index=i;

return max_index;

}

template <typename type>

void show(const vector<type>&stuff)

{

for (int i=0; i<stuff.size(); i++)

cout <<stuff[i]<<' ';

}

int main()

{

vector<string> names;

vector<int> votes;

string name;

int vote;

int size=5;

for (int i=0; i<size;++i)

{

cout<<"enter candidates "<< i+1<<" name: ";

getline(cin, name,'\n');

cout<<"Enter "<<name<< "'s votes ";

cin>>vote;

cin.get();

names.push_back(name);

votes.push_back(vote);

}

  

for (int k=0; k<size;++k)

{

sort(names.begin(),names.end());

if (names[k-1]==names[k]){

return votes[k];

cout<<"votes "<<votes[k]<<endl;

}

}

int max_index= max_element(votes);

for (int j=0;j<size;++j){

if (votes[j]==votes[max_index])

cout<<"The winners list is bellow "<< names[j]<<endl;

}

return 0;

}

In: Computer Science

JAVASCRIPT: Please create an array of student names and another array of student grades. - Create...

JAVASCRIPT:

Please create an array of student names and another array of student grades.
- Create a function that can put a name and a grade to the arrays.
- Keep Read student name and grade until student name is “???”. And save the reading by using a function
- Create another function to show all the grade in that object.
- Create the third function that can display the maximum grade and the student’s name.
- Create a sorting function that can sort the arrays based on the student’s grade.
- Display all the grades and names sorted by the grade.

Please modify the JavaScript code (HTML) below to meet the requirements, and submit it. Also submit a screenshot of the output.

<html>
<body>
<script>
//store student name in student array and the grade in grade array
function spush(slist, name, sgrade, grade){
slist.push(name);//student list
   sgrade.push(grade);//grade list
}
//show all the student names and their grades
function showlist(slist, sgrade){
var i;
for (i = 0; i < slist.length; i++){
document.writeln(slist[i] +" "+sgrade[i]+ "<br>");
}
}
function findmax(sgrade){
var i;
   var max;
   var maxid;
   max = sgrade[0];
   maxid = 0;
  
   for(i=1;i<sgrade.length; i++){
   if(max < sgrade[i]){
   max = sgrade[i];
       maxid = i;
   }}
  
return maxid;//using index number
   }
var stdlist = [];
var sgrade =[];
var mid;
//instead of following, please use prompt for input
spush(stdlist, "John", sgrade, 90);
spush(stdlist, "Tom", sgrade, 95);
spush(stdlist, "Mary", sgrade, 97);
showlist(stdlist, sgrade);
mid = findmax(sgrade);//max grade index number
  
document.writeln("The maximum grade: "+stdlist[mid]+" "+sgrade[mid]);
</script>
</body>
</html>

In: Computer Science

Read Ch. 3. Using the C++ editor, type the following program: #include <iostream> #include <string> using...

  1. Read Ch. 3. Using the C++ editor, type the following program:

#include <iostream>

#include <string>

using namespace std;

int main ()

{

       //declarations

string name;

       //input

cout <<"Enter your first name" << endl;

       cin >> name;

       //output

       cout << "Hello " << name << "! " << endl;

       return 0;

}

  1. Compile and run. What does the cin statement do?
  2. What does the cout statement do?
  3. Is name a variable or a constant?
  4. What type is name?
  5. Add the following line to the declaration statements:

int age;

Add the following lines to your program:

cout << “Enter your age” << endl;

cin >> age;

Compile and Run.

What type is age? Describe this type.

  1. Add a line to print the age to the screen. Compile and Run.
  2. Add the following line to the declaration statements:

float bodyTemp;

              Add the lines to input and out your body temperature. Compile and run.

              What type is bodyTemp? Describe this type.

  1. Add the appropriate declaration, input and output statement for each of the following:

Height (hint, use two variables)

Weight

Sex (hint, use the char type)

Last name

  1. Turn in:
    1. The final program
    2. The final output

Answers to these questions only:

  1. What is the integer data type and how is it declared in C++?
  2. Give an example of where the integer type might be used.
  3. What is the real data type and how is it declared in C++?
  4. Give an example of where the real type might be used.
  5. What is the string data type and how is a string declared in C++?
  6. Give an example of where the string type might be used.
  7. What is the boolean type and how is an boolean declared in C++?
  8. Give an example of where the boolean type might be used.

In: Computer Science

C++ using vectors. in the following code, if a user adds duplicate names the votes should...

C++ using vectors.

in the following code, if a user adds duplicate names the votes should be added to only one of the names:

example

display "Enter candidate name: "

input john

display "Enter candidate vote:"

input 10

display "Enter candidate name: "

input john

display "Enter candidate vote:"

input 10

so the output has to be

john with 20 votes.

#include<iostream>

#include<iterator>

#include<string>

#include<algorithm>

#include<array>

#include<ctime>

#include <vector>

#include<bits/stdc++.h>

using namespace std;

int max_element(const vector<int>&stuff)

{

int max_index =0;

for (int i=1; i<stuff.size();++i)

if (stuff[i]>stuff[max_index])

max_index=i;

return max_index;

}

template <typename type>

void show(const vector<type>&stuff)

{

for (int i=0; i<stuff.size(); i++)

cout <<stuff[i]<<' ';

}

int main()

{

vector<string> names;

vector<int> votes;


string name;

int vote;

int size=5;

for (int i=0; i<size;++i)

{

cout<<"enter candidates "<< i+1<<" name: ";

getline(cin, name,'\n');

cout<<"Enter "<<name<< "'s votes ";

cin>>vote;

cin.get();

names.push_back(name);

votes.push_back(vote);

}

  

for (int k=0; k<size;++k)

{

sort(names.begin(),names.end());

if (names[k-1]==names[k]){

return votes[k];

cout<<"votes "<<votes[k]<<endl;

}

}

int max_index= max_element(votes);

for (int j=0;j<size;++j){

if (votes[j]==votes[max_index])

cout<<"The winners list is bellow "<< names[j]<<endl;

}

return 0;

}

In: Computer Science

Instructions Write a program in C++ that create a LookupNames project. In the main function: Ask...

Instructions

Write a program in C++ that create a LookupNames project.

In the main function:
Ask the user to enter a number of names, X to quit input.
Store the names in an array.
Also use a counter variable to count the number of names entered.

Write a function displayNames to display the names.
The function must receive the array and the counter as parameters.

Write a function called lookupNames.
The function must receive the array and the counter as parameters.
Ask the user to enter a letter.
Display all the names with the letter that was entered as the first letter of the name.

Call the displayNames and lookupNames functions from the main function.


Tip: declare your functions above the main() function:

void displayNames(char array[][60], int count)
{
// function code here
}

int main()
{
// main code here
displayNames(names, number);
// possible more code here
}

Tip2: make sure your function parameter matches the data type you send as an argument to that function.
In the above example, names and array should have the same data type, and number and count should have the same data type.


Enter name (X to quit input): John Peterson
Enter name (X to quit input): Diane Lee
Enter name (X to quit input): James Smith
Enter name (X to quit input): Frank Xaba
Enter name (X to quit input): Jacky Mokabe
Enter name (X to quit input): x


List of Names

John Peterson
Diane Lee
James Smith
Frank Xaba
Jacky Mokabe

Enter a letter: J

Names starting with the letter J

John Peterson
James Smith
Jacky Mokabe

In: Computer Science

We can experiment with two parallelepipeds (boxes) that are similar in shape. The dimensions of the...

We can experiment with two parallelepipeds (boxes) that are similar in shape. The dimensions of the smaller box are 2 in. x 4 in. x 3 in. The larger box has twice the dimensions of the smaller . Draw and label the large box

1. Surface area (SA) of a box is the sum of the areas of all six sides. Compare the SAs of the two boxes.

top or bottom front or back side total surface area
Small box 2x4= 8 in sq. 3x4=12 in sq. 2x3= 6 in sq. 2(8+12+6)=52 in. sq.
Large Box

Ratio: SA of the large box is ___ times the SA of the small box

2. Compare the volumes (V) of the two boxes, measured in cubic inches. Pretend that you are filling the boxes with 1-inch cubes. The volume of each cube is 1 cubic inch (cu. in.).

Small box ____ cubes fill one layer, and ___ layers fill the box. The box holds ___ 1-inch cubes. Volume= ____ cu. in. Large box ___ cubes fill one layer, and ___ layers fill the box The box holds ____ 1-inch cubes. Volume= ___ cu. in. Ratio: The volume of the large box is ___ times the volume of the small box.

3. Show your work to compare a 3inch cube with a I-inch cube.

large cube small cube ratio: large to small
length of side 3 in. 1 in. 3 to 1
surface area
volume

Think about this: 1. Look at your estimate for the amount of thatch for the kibo Art Gallery. Do you agree with it? Explain.

2. Two cylinders (cans) have similar shapes. One has four times the dimensions of the other. Show how you can compare their surface areas and volumes without the use of formulas. What conclusions do you expect? Use another sheet, if necessary.

In: Math

Financing Deficit Stevens Textile Corporation's 2016 financial statements are shown below: Balance Sheet as of December...

Financing Deficit

Stevens Textile Corporation's 2016 financial statements are shown below:

Balance Sheet as of December 31, 2016 (Thousands of Dollars)

Cash $ 1,080 Accounts payable $ 4,320
Receivables 6,480 Accruals 2,880
Inventories 9,000 Line of credit 0
   Total current assets $16,560 Notes payable 2,100
Net fixed assets 12,600    Total current liabilities $ 9,300
Mortgage bonds 3,500
Common stock 3,500
Retained earnings 12,860
   Total assets $29,160    Total liabilities and equity $29,160

Income Statement for January 1 - December 31, 2016 (Thousands of Dollars)

Sales $36,000
Operating costs 32,440
   Earnings before interest and taxes $ 3,560
Interest 460
   Pre-tax earnings $ 3,100
Taxes (40%) 1,240
Net income $ 1,860
Dividends (45%) $  837
Addition to retained earnings $ 1,023

Suppose 2017 sales are projected to increase by 25% over 2016 sales. Use the forecasted financial statement method to forecast a balance sheet and income statement for December 31, 2017. The interest rate on all debt is 9%, and cash earns no interest income. Assume that all additional debt in the form of a line of credit is added at the end of the year, which means that you should base the forecasted interest expense on the balance of debt at the beginning of the year. Use the forecasted income statement to determine the addition to retained earnings. Assume that the company was operating at full capacity in 2016, that it cannot sell off any of its fixed assets, and that any required financing will be borrowed as a line of credit. Also, assume that assets, spontaneous liabilities, and operating costs are expected to increase by the same percentage as sales. Determine the additional funds needed. Round your answers to the nearest dollar. Do not round intermediate calculations.

Total assets ______ $
AFN ________ $

What is the resulting total forecasted amount of the line of credit? Round your answer to the nearest dollar. Do not round intermediate calculations.
Line of credit _______$

In: Finance