Questions
Question 1 (25pts): Consider the string “data and program analytics”. Write a program to perform the...

Question 1 (25pts):

Consider the string “data and program analytics”. Write a program to perform the following actions

  • Find the index of the character ‘p’ in the given string
  • Print the character which is present at index number seven
  • Find the length of the String
  • Split the string at every occurrence of a whitespace
  • Replace the word “data” in the original string with “information” using a standard string manipulation function. Your output after the manipulation should be “information and program analytics”

Question 2 (15 pts):

List1 = [3, 4, 5, 20, 5]

  • Find the index of the second 5
  • Find the last element of this list

Question 3 (15 pts):

Set1 = {1, 2, 3, 4}, Set2={4, 5, 6}

  • Print all elements that appear in both sets
  • Print those elements that appear in either set
  • Print all elements that appear in Set1 but not Set2

Question 4 (15 pts):

L = [('',), (), ('apple', 1), (), ("Paul", "Merage', 2020, "MSBA212"), ("d")]

Write a Python program to remove an empty tuple(s) from a list of tuples.

Expected outcome is:

[('',), ('apple', 1), ('Paul', 'Merage', 2020, 'MSBA212'), 'd']

Question 5 (15 pts):

  • Reverse words in the string "one apple a day keeps the doctors away" and print the new string
  • Sort the words in the string "one apple a day keeps the doctors away" alphabetically and then print the new string.

Question 6 (15 pts):

Two given lists [1,2,4,8,5,10] and [2,4,5,8,12,15], write a program to make a list whose elements are intersection of the above given lists.

In: Computer Science

Instructions Complete the lab using “for loop”. Do not write the code in multiple programs. All...

Instructions

  • Complete the lab using “for loop”.
  • Do not write the code in multiple programs. All the 3 methods should be written in 1 program.
  1. Write a java program calls the following methods:
    1. printStars(): Takes an int (n) as parameter and prints n stars (*) using for loop.
    2. Multiples(): Takes an int (n) as parameter and prints first 10 multiples n in a single line using for loop.
    3. hasAnEvenDigit: Takes an int (n) as parameter and returns whether n has at least one digit whose value is even. Return true if the number has at least one even digit else false if none of the digits are even. For example, the call hasAnEvenDigit(33267) should return true and hasAnEvenDigit(7591) should return false.

[Hint: n%10 returns the last digit and n/10 returns everything except the last digit]

In: Computer Science

imagine you have graduated from UCD, you have been hired by a business as a Manager...

imagine you have graduated from UCD, you have been hired by a business as a Manager over a specific function. You have six direct reports assigned to you. Today is your first day on the job. Your Manager has asked to meet with you late today – she has stated that in your meeting late this afternoon she would like to have you review your plan with her on how you will lead and manage your department. You know that getting off to a strong start is very important. You have only briefly met your direct reports, but have gained a strong sense that they are eager to get to know you and provide direction going forward. You know that their last manager was as one of them stated to you, “a real disaster!”

Consider the following questions and use them as you build the plan you will review with your manager later today:

  • What will you do today – day one on the job?
  • What will you do over the next 30 days?
  • What will you do over the next 6 months?
  • How will you assure that your manager, your directs, your peers are aligned and supportive of your approach?
  • What management approach will you take to ‘enable’ strong team success?
  • How will you measure your managerial success over the first 6 months?

In: Operations Management

Please read the article on "HOW DO CFOS MAKE CAPITAL BUDGETING AND CAPITAL STRUCTURE DECISIONS?" and...

  1. Please read the article on "HOW DO CFOS MAKE CAPITAL BUDGETING AND CAPITAL STRUCTURE DECISIONS?" and explain the most popular Capital Budgeting Technique.

In: Finance

Computer Science Question 1: DO NOT USE ANY NON-STANDARD LIBRARY. o All the required libraries have...

Computer Science Question 1:

DO NOT USE ANY NON-STANDARD LIBRARY. o All the required libraries have already been included. O DO NOT INCLUDE ANY OTHER LIBRARY INTO THE CODE. o DO NOT ALTER THE NAMES OF THE C FILES PROVIDED. o DO NOT ALTER THE NAMES AND PROTOTYPES OF THE FUNCTIONS.DO NOT ALTER ANY OF THE CODE! JUST ADD WHAT NEEDS TO BE ADDED FOR IT TO WORK! Please copy and paste the whole solution. Please read the code below and complete what it is asking.

This is the code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define SIZE 20

// A regular function to check and return the maximum value between two integers
int max(int a, int b);

// A recursive function for recursively find and return the maximum value in an array of integers
int maximumValue(int a[], int size);

int main(void) {

        srand(time(NULL));

        int myArray[SIZE];

        // COMPLETE THIS PART
        // ******************
        // populate the array with positive random integers less than 100





        // COMPLETE THIS PART
        // ******************
        // Print out the elements of the array in one line





        // COMPLETE THIS PART
        // ******************
        // Find and print out the maximum value in the array by calling the recursive function maximumValue



}

int max(int a, int b) {

        // COMPLETE THIS PART
        // ******************
        // if a is greater than or equal to b, return a, otherwise return b


}

int maximumValue(int a[], int size) {

        // COMPLETE THIS PART
        // ******************
        // Base case and recursive part using an if-else statement.
        // Base case:
        //              If there is only one element in the current array, return it.
        // Recursive part:
        //              Call the max function with two parameters, the first element of the array and maximumValue of the rest of the array.

In: Computer Science

Julia throws a 2.0kg rock at 11.0m/s from the ground at an angle of 50 degrees...

Julia throws a 2.0kg rock at 11.0m/s from the ground at an angle of 50 degrees from horizontal toward a building. If the base of the building is 5.0m away from her, then what is the a) Kinetic Energy and b) Work done by gravity on the rock when it hits the wall?

In: Physics

A transport logistics company (using trucks) is planning to purchase 30 laptops for its employees. (i)...

A transport logistics company (using trucks) is planning to purchase 30 laptops for its employees.

(i) Explain (in detail) what is meant by the term “total cost of ownership” in this acquisition?

(ii) For support purposes, you are asked to prepare a plan to prevent users from encountering problems (or even misusing) the new laptops. Select five different end user problem types and describe the common issues and preventative measures.

In: Computer Science

Share a current example of a health care reform imitative being considered at the federal or...

Share a current example of a health care reform imitative being considered at the federal or state level. What does current peer-reviewed literature from the last three years say on this topic?

In: Operations Management

How has federalism evolved from the founding of the republic to contemporary times? How does federalism...

How has federalism evolved from the founding of the republic to contemporary times?

How does federalism play out in any contemporary issue of your choice?

In: Psychology

write an essay comparing and contrasting as mentioned below Radio vs newspapers. what are the similarities...

write an essay comparing and contrasting as mentioned below

Radio vs newspapers. what are the similarities and differences?

In: Computer Science

“Do you believe our unconscious reactions come out of a locked room that we can’t ever...

“Do you believe our unconscious reactions come out of a locked room that we can’t ever truly see inside? Can we ever know ourselves wholly and understand the motivations and reasons behind our every move? If an individual claims to completely know how her mind works, is she incredibly self-aware or is she delusional? And if we can’t ever get behind that door and fully know why we react the way we do, is psychiatry an overpriced and limited exercise?” (Gladwell, 2005, p. 13)

In: Psychology

You own a small company. Last year you conducted a study to learn more about your...

You own a small company. Last year you conducted a study to learn more about your customers. You found that the mean age of your customers was 31.84 years with a standard deviation of 9.84 years. This year you take a random sample of 60 customers. What is the probability that the mean age of those 60 customers is greater than 33 years?

In: Math

If fungi were to disappear completely from earth what might happen? List at least 3 different...

If fungi were to disappear completely from earth what might happen? List at least 3 different consequences

In: Biology

C# Write a program in C# that prompts the user for a name, Social Security number,...

C#

Write a program in C# that prompts the user for a name, Social Security number, hourly pay rate, and number of hours worked. In an attractive format, dis- play all the input data as well as the following: » Gross pay, defined as hourly pay rate times hours worked » Federal withholding tax, defined as 15% of the gross pay » State withholding tax, defined as 5% of the gross pay » Net pay, defined as gross pay minus taxes

In: Computer Science

should High Frequency trading be more regulated or not and explain why it should or shouldn't...

should High Frequency trading be more regulated or not and explain why it should or shouldn't be more regulated ?

In: Finance