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.. 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 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:
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. 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 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 Database will keep track of the following:
In: Computer Science
PYTHON.
Tasks:
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 the homework. You will also need to place a semicolon after each SQL statement, a requirement for SQL files containing multiple SQL statements
In: Computer Science
In: Economics
In: Computer Science