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

The comparative balance sheet of Whitman Co. at December 31, 2016 and 2015, is as follows:...

The comparative balance sheet of Whitman Co. at December 31, 2016 and 2015, is as follows:

1

Dec. 31, 2016

Dec. 31, 2015

2

Assets

3

Cash

$917,690.00

$964,930.00

4

Accounts receivable (net)

?828,620.00

762,860.00

5

Inventories

1,267,970.00

1,162,780.00

6

Prepaid expenses

29,050.00

36,010.00

7

Land

315,250.00

480,690.00

8

Buildings

1,462,990.00

901,470.00

9

Accumulated depreciation-buildings

(409,170.00)

(382,690.00)

10

Equipment

511,480.00

453,680.00

11

Accumulated depreciation-equipment

(142,100.00)

(159,400.00)

12

Total assets

$4,781,780.00

$4,220,330.00

13

Liabilities and Stockholders’ Equity

14

Accounts payable (merchandise creditors)

$923,380.00

$958,540.00

15

Bonds payable

269,000.00

0.00

16

Common stock, $25 par

323,000.00

118,000.00

17

Paid-in capital: Excess of issue price over par—common stock

771,200.00

558,000.00

18

Retained earnings

2,495,200.00

2,585,790.00

19

Total liabilities and stockholders’ equity

$4,781,780.00

$4,220,330.00

The noncurrent asset, noncurrent liability, and stockholders’ equity accounts for 2016 are as follows:

ACCOUNT Land

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 480,690
Apr. 20 Realized $153,400 cash from sale 165,440 315,250

ACCOUNT Buildings

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 901,470
Apr. 20 Acquired for cash 561,520 1,462,990

ACCOUNT Accumulated Depreciation––Buildings

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 382,690
Dec. 31 Depreciation for year 26,480 409,170

ACCOUNT Equipment

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 453,680
26 Discarded, no salvage 46,270 407,410
Aug. 11 Purchased for cash 104,070 511,480

ACCOUNT Accumulated Depreciation ––Equipment

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 159,400
26 Equipment discarded 46,270 113,130
Dec. 31 Depreciation for year 28,970 142,100

ACCOUNT Bonds Payable

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
May 1 Issued 20-year bonds 269,000 269,000

ACCOUNT Common Stock $25 par

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 118,000
Dec. 7 Issued 8,200 shares of common stock for $51 per share 205,000 323,000

ACCOUNT Paid-In Capital in Excess of Par––Common Stock

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 558,000
Dec. 7 Issued 8,200 shares of common stock for $51 per share 213,200 771,200

ACCOUNT Retained Earnings

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 2,585,790
Dec. 31 Net loss 58,980 2,526,810
31 Cash dividends 31,610 2,495,200

Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.

Labels and Amount Descriptions

Labels and Amount Descriptions
Cash paid for acquisition of building
Cash paid for dividends
Cash paid for merchandise
Cash paid for purchase of equipment
Cash received from customers
Cash received from issuance of bonds payable
Cash received from issuance of common stock
Cash received from land sold
December 31, 2016
Decrease in accounts payable
Decrease in accounts receivable
Decrease in cash
Decrease in inventories
Decrease in prepaid expenses
Decrease in salaries payable
Depreciation
For the Year Ended December 31, 2016
Gain on sale of investments
Gain on sale of land
Increase in accounts payable
Increase in accounts receivable
Increase in cash
Increase in inventories
Increase in prepaid expenses
Increase in salaries payable
Issuance of common stock for acquisition of building
Issuance of common stock for purchase of equipment
Issuance of common stock to retire bonds
Loss on sale of investments
Loss on sale of land
Net cash flow from financing activities
Net cash flow from investing activities
Net cash flow from operating activities
Net cash flow used for financing activities
Net cash flow used for investing activities
Net cash flow used for operating activities
Net income
Net loss

Statement of Cash Flows

Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.

Whitman Co.

Statement of Cash Flows

1

Cash flows from operating activities:

2

3

Adjustments to reconcile net loss to net cash flow from operating activities:

4

5

6

Changes in current operating assets and liabilities:

7

8

9

10

11

12

13

Cash flows from investing activities:

14

15

16

17

18

19

Cash flows from financing activities:

20

21

22

23

24

25

Cash at the beginning of the year

26

Cash at the end of the year

In: Accounting

The comparative balance sheet of Whitman Co. at December 31, 2016 and 2015, is as follows:...

The comparative balance sheet of Whitman Co. at December 31, 2016 and 2015, is as follows:

1

Dec. 31, 2016

Dec. 31, 2015

2

Assets

3

Cash

$918,260.00

$965,110.00

4

Accounts receivable (net)

 828,050.00

761,830.00

5

Inventories

1,268,550.00

1,163,510.00

6

Prepaid expenses

28,760.00

35,720.00

7

Land

315,810.00

479,900.00

8

Buildings

1,463,300.00

900,740.00

9

Accumulated depreciation-buildings

(408,350.00)

(381,910.00)

10

Equipment

512,470.00

454,060.00

11

Accumulated depreciation-equipment

(142,270.00)

(159,730.00)

12

Total assets

$4,784,580.00

$4,219,230.00

13

Liabilities and Stockholders’ Equity

14

Accounts payable (merchandise creditors)

$922,360.00

$957,810.00

15

Bonds payable

270,000.00

0.00

16

Common stock, $25 par

316,000.00

116,000.00

17

Paid-in capital: Excess of issue price over par—common stock

775,000.00

559,000.00

18

Retained earnings

2,501,220.00

2,586,420.00

19

Total liabilities and stockholders’ equity

$4,784,580.00

$4,219,230.00

The noncurrent asset, noncurrent liability, and stockholders’ equity accounts for 2016 are as follows:

ACCOUNT Land

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 479,900
Apr. 20 Realized $152,430 cash from sale 164,090 315,810

ACCOUNT Buildings

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 900,740
Apr. 20 Acquired for cash 562,560 1,463,300

ACCOUNT Accumulated Depreciation––Buildings

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 381,910
Dec. 31 Depreciation for year 26,440 408,350

ACCOUNT Equipment

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 454,060
26 Discarded, no salvage 47,260 406,800
Aug. 11 Purchased for cash 105,670 512,470

ACCOUNT Accumulated Depreciation ––Equipment

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 159,730
26 Equipment discarded 47,260 112,470
Dec. 31 Depreciation for year 29,800 142,270

ACCOUNT Bonds Payable

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
May 1 Issued 20-year bonds 270,000 270,000

ACCOUNT Common Stock $25 par

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 116,000
Dec. 7 Issued 8,000 shares of common stock for $52 per share 200,000 316,000

ACCOUNT Paid-In Capital in Excess of Par––Common Stock

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 559,000
Dec. 7 Issued 8,000 shares of common stock for $52 per share 216,000 775,000

ACCOUNT Retained Earnings

ACCOUNT NO.
Balance
Date Item Debit Credit Debit Credit
2016
Jan. 1 Balance 2,586,420
Dec. 31 Net loss 53,460 2,532,960
31 Cash dividends 31,740 2,501,220

Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.

Labels and Amount Descriptions

Labels and Amount Descriptions
Cash paid for acquisition of building
Cash paid for dividends
Cash paid for merchandise
Cash paid for purchase of equipment
Cash received from customers
Cash received from issuance of bonds payable
Cash received from issuance of common stock
Cash received from land sold
December 31, 2016
Decrease in accounts payable
Decrease in accounts receivable
Decrease in cash
Decrease in inventories
Decrease in prepaid expenses
Decrease in salaries payable
Depreciation
For the Year Ended December 31, 2016
Gain on sale of investments
Gain on sale of land
Increase in accounts payable
Increase in accounts receivable
Increase in cash
Increase in inventories
Increase in prepaid expenses
Increase in salaries payable
Issuance of common stock for acquisition of building
Issuance of common stock for purchase of equipment
Issuance of common stock to retire bonds
Loss on sale of investments
Loss on sale of land
Net cash flow from financing activities
Net cash flow from investing activities
Net cash flow from operating activities
Net cash flow used for financing activities
Net cash flow used for investing activities
Net cash flow used for operating activities
Net income
Net loss

Statement of Cash Flows

Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.

Whitman Co.

Statement of Cash Flows

1

Cash flows from operating activities:

2

3

Adjustments to reconcile net loss to net cash flow from operating activities:

4

5

6

Changes in current operating assets and liabilities:

7

8

9

10

11

12

13

Cash flows from investing activities:

14

15

16

17

18

19

Cash flows from financing activities:

20

21

22

23

24

25

Cash at the beginning of the year

26

Cash at the end of the year

In: Accounting