Questions
so i want to read in a file. just to keep it simple, the text file...

so i want to read in a file. just to keep it simple, the text file has student name and the grade, separated by a space. let's say there are 192 student's name and I want to read them in and made them into a Student /object class, which has a constructor, student(string name, int grade). individually creating them seems pain in the ass. reading in should work for any number of names.

So how do I do this in c++?

In: Computer Science

Carla Vista Co. owns a trade name that was purchased in an acquisition of Wildhorse Co.....

Carla Vista Co. owns a trade name that was purchased in an acquisition of Wildhorse Co.. The trade name has a book value of $3,500,000, but according to IFRS, it is assessed for impairment on an annual basis. To perform this impairment test, Carla Vista must estimate the fair value of the trade name (using IFRS 13). It has developed the following cash flow estimates related to the trade name based on internal information. Each cash flow estimate reflects Carla Vista’s estimate of annual cash flows over the next 10 years. The trade name is assumed to have no salvage value after the 10 years. (Assume the cash flows occur at the end of each year.)

Cash Flow Estimate

Probability Assessment

$387,500 20 %
631,500 50 %
745,000 30 %



Click here to view the factor table PRESENT VALUE OF 1.
Click here to view the factor table PRESENT VALUE OF AN ANNUITY OF 1.

(a)

What is the estimated fair value of the trade name? Carla Vista determines that the appropriate discount rate for this estimation is 10%. (For calculation purposes, use 5 decimal places as displayed in the factor table provided. Round final answer to 0 decimal places, e.g. 5,275.)

Estimated fair value

$Enter your answer in accordance to the question statement

In: Accounting

Write a program that reads students’ names followed by their test scores. The program should output...

Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and 100), and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType. Your program must contain at least the following functions:

  1. A function to read the students’ data into the array.
  2. A function to assign the relevant grade to each student.
  3. A function to find the highest test score.
  4. A function to print the names of the students having the highest test score.

Your program must output each student’s name in this form: last name followed by a comma, followed by a space, followed by the first name; the name must be left justified. Moreover, other than declaring the variables and opening the input and output files, the function main should only be a collection of function calls.

This should be written in C++ please thank you.

Data must be read from a file

In: Computer Science

Control Flow 1. What is the difference between 10 / 3 and 10 // 3? 2....

Control Flow

1. What is the difference between 10 / 3 and 10 // 3?

2. What is the result of 10 ** 3?

3. Given (x = 1), what will be the value of after we run (x += 2)?

4. How can we round a number?

5. What is the result of float(1)?

6. What is the result of bool(“False”)?

7. What is the result of 10 == “10”?

8. What is the result of “bag” > “apple”?

9. What is the result of not(True or False)?

10. Under what circumstances does the expression 18 <= age < 65 evaluate to True?

Primitive Types

1. What is a variable?

2. What are the primitive built-in types in Python?

3. When should we use “”” (tripe quotes) to define strings?

4. Assuming (name = “John Smith”), what does name[1] return?

5. What about name[-2]?

6. What about name[1:-1]?

7. How to get the length of name?

8. What are the escape sequences in Python?

9. What is the result of f“{2+2}+{10%3}”?

10. What does name.strip() do?

11. How can we check to see if name contains “John”?

12. What are the 3 types of numbers in Python?



In: Computer Science

Q1) Create a function called max that receives two integer values and returns the value of...

Q1) Create a function called max that receives two integer values and returns the value of the bigger integer.

Q2) Complete the missing code in the following program. Assume that a cosine function has already been created for you. Consider the following function header for the cos function. double cos (double x) #include void output_separator() { std::cout << "================"; } void greet_name(string name) { std::cout << "Hey " << name << "! How are you?"; } int sum(int x, int y){ return x + y; } int main() { std::string name; int num1, num2, result; double num_dec, result_dec; std::cout << "Please enter your name: "; std::cin >> name; Answer ; // call the greet_name function and pass the user's name Answer ; // call the output_separator function std::cout << "Please input 2 integer values: "; std::cin >> num1 >> num2; std::cout << "Please input a double value: "; std::cin >> num_dec; std::cout << "Here are the results of my function test"; Answer ; // store the result of the sum function into // result and pass num1 and num2 as parameters std::cout << "Sum result: " << result; Answer ; // store the result of the cos function into // result_dec and pass num_dec as the parameter std::cout << "Cosine result: " << result_dec; return 0; }

In: Computer Science

Draw a Schema Diagram using the information. Signum Libri (SL) is a publishing company. SL Operations...

Draw a Schema Diagram using the information.

Signum Libri (SL) is a publishing company.

SL Operations Database will keep track of the following:

  • For each book SL publishes: a book name, genre, date of publication, and number of pages;
  • For each writer: a unique writer identifier as well as the writer’s name;
  • For each agent: a unique agent identifier as well as the agent’s name;
  • For each editor: a unique editor identifier as well as the editor’s name;
  • Each SL book is written by one writer, and each writer can write many SL books. SL will not keep track of writers who did not write a book for SL. All books written by the same writer have a different book name. However, two writers can write two different books with the same book name.
  • Each writer is represented by one agent. Each agent represents at least one writer, but can represent many.
  • Each book has one editor. Each editor edits at least one book, but can edit many books.
  • Each editor can mentor one or more other editors, but does not have to mentor any. Each editor can have at most one mentor editor, but does not have to have any

In: Computer Science

PYTHON. Tasks: Create and test the openFileReadRobust() function to open file (for reading) whose name is...

PYTHON.

Tasks:

  1. Create and test the openFileReadRobust() function to open file (for reading) whose name is provided from the standard input (keyboard) – the name is requested until it is correct
  2. Create and test the openFileWriteRobust () function to open file (for writing) whose name is provided from the standard input (keyboard) – the name is requested until is correct
  3. Extend the program to count number of characters, words and lines in a file as discussed in the classby including openFileReadRobust() and openFileWriteRobust () functions
  4. Create simple tallying program to input sequence of integers (each integer 0-100) from a file (name to be entered from the keyboard using openFileReadRobust() function), compute the tally sheet discarding all bad data. Display the discarded bad data on the screen.
  5. Write the content of the tally sheet (write only non-zero counts of numbers – numbers that are in the input file) to a standard output (the shell window).
  6. Extend the program to write the content of the tally sheet (write only non-zero counts of numbers – numbers that are in the input file) to a file (name to be entered from the keyboard). Display the content of the file on the screen.

Assume the content of the file myData1.txt:

5

100

111

OK

55

5

55

5

The interaction of your program should be displayed in the Shell window similarly as shown below:

Task 1

What is the input file name?

myData.txt

This file cannot be opened

What is the input file name?

myData1.txt

Task 2

What is the output file name?

myResults1.txt

Task 3

The number of characters is: 15

The number of words is: 8

The number of lines is: 8

Task 4

Discarded bad data: 111, OK

Task 5

The tally sheet based on your input file is:

Number of 5’s: 3

Number of 55’s: 2

Number of 100’s: 1

Task 6

The tally sheet written to the file: myResults1.txt

Copy of the content of the file myResults1.txt is:

Number of 5’s: 3

Number of 55’s: 2

Number of 100’s: 1

In: Computer Science

Create one sql script file to complete the following. You cannot run separate SQL statements for...

Create one sql script file to complete the following. You cannot run separate SQL statements for the homework. You will also need to place a semicolon after each SQL statement, a requirement for SQL files containing multiple SQL statements

  • Lesson 3
    1. Write a query to display the current date. Label the column DATE.
    2. Display the last name of all employees who have an A and an E in their last name.
    3. For each employee, display the employee number, last_name, salary, and salary if it were increased by 18%
      and expressed as a whole number.
    4. Modify the previous query to add a column that will subtract the old salary from the new salary. Label the column INCREASE .
    5. Display the employee's name, hire date, and salary review date, which is the first Monday after six months of service. Label the column REVIEW. Format the dates to appear in the format similar to "Sunday, the Seventh of September, 1981.
    6. For each employee display the employee name and calculate the number of months between today and the date the employee was hired. Label the column MONTHS_WORKED. Order your results by the number of months employed. Round the number of months up to the closest whole number.
    7. For each employee, display an output in this format: Employee earns monthly but wants <3 times salary>. Title the column Dream Salaries.
      Dream Salaries
      KING earns $5,000.00 monthly but wants $15,000.00.
      BLAKE earns $2,850.00 monthly but wants $8,550.00.
      CLARK earns $2,450.00 monthly but wants $7,350.00.

    8. Write a query to display name and salary for all employees. Format the salary to be 15 characters long, left-padded with $s. Label the column SALARY.
    9. Write a query that will display the employee's name with the first letter capitalized and all other letters lowercase along with the length of their name, restrict your results to include only employees whose name starts with J, A, or M. Give each column an appropriate label.
    10. Display the name, hire date, and day of the week on which the employee started. Label the column DAY. Order the results by the day of the week starting with Monday.

In: Computer Science

what is the avearage cost of living and the average retirement age for the whole US...

what is the avearage cost of living and the average retirement age for the whole US form the year 2016-2017 based on zip code

In: Economics

Explain how folder and file auditing works within Microsoft Server 2016 and describe why a business...

Explain how folder and file auditing works within Microsoft Server 2016 and describe why a business may want to use it.

In: Computer Science