FYIPI
(Find yourself in PI)
In this assignment you will find a numeric string (if it exists) within a file containing the first 1 million characters of the decimal expansion of PI. The numeric string in question is a 6 character string representing your birth date. E.g., if your birth date is January 1, 1984, then the string is 010184. The file containing the first 1 million characters of the
decimal expansion of PI is named pidigits.txt and is available for download from D2L. Your code should prompt the user for their birthday and then verify that the string entered by the user is indeed a valid date string. Invalid date strings include the following:
013284 // No month has more than 31 days
022905 // 2005 was not a leap year
150184 // There are only 12 months
093196 // September only has 30 days
etc.
Thus, a birth date string is of the form:
mmddyy
where mm is a two digit string representing the month, dd is a two digit string representing the day and yy is a two digit string representing the year.
Once a birth date string has been entered by the user and validated, you will open pidigits.txt and read in asingle character at a time using a BufferedReader instance. If a non-digit character such as a space, tab, or blank line is read, discard it. If the character is a digit character, “keep it” until a match/non-match has been established. As you read the characters, if there is a match between the birth date string and the characters read, report this to the user. Your code must find all such matches in the file, report all such matches to the user, report the character position in the file at which a given match begins, report the number of comparisons made in establishing the match, and report the total number of comparisons used in reading the entire file.. The format used for reporting is:
Your birthday 022348 was found at character position 1013664 in pidigits.txt
The number of comparisons so far is: 919560
Your birthday 022348 was found at character position 1073634 in pidigits.txt
The number of comparisons so far is: 973942
The total number of comparisons made in reading this file is: 1111091
If there are no matches for the birth date string, then your code should simply output the total number of comparisons made in reading the file.
Constraints:
Your must use BufferedReader for all IO. No Scanner instances nor JOptionPanes allowed. Failure to observe this constraint will result in a significant loss of points.
Each character in pidigits.txt will be read in exactly once using the read() method of the BufferedReader class. You must use the version of read() that takes no parameters. You do not need to “back up” and reread characters that have already been read. Failure to observe this constraint will result in a significant loss of points.
You are not allowed to store the characters read in an array or any other kind of container. They are to be stored in char variables only. It should be obvious that you need only 6 such variables for this assignment. Failure to observe this constraint will result in a significant loss of points.
You are not allowed to use any methods from the String class for finding matches. You may and should use the isDigit() method. The isDigit() method is a static method in the Character class. Failure to observe this constraint will result in a significant loss of points.
Your code must validate that the birth date string entered by the user is indeed a valid date. You must do this by passing the string as a parameter to a constructor of some sort of Date class. The Date class can be one that you build from scratch or can be based on one of the Date classes in the Java API (Calendar, GregorianCalendar, etc.). The code in your Date class is allowed to use methods from the String class. Failure to observe this constraint will result in a significant loss of points.
The name of the file containing your main() method must be YourFirstNameYourLastNameIV.java. The name of the file containing your code for your Date class must be BirthDate.java. Failure to observe this constraint will result in a significant loss of points.
Please do not submit anything other than source code files. .class files, etc. are neither wanted nor welcome.
This is in Java
In: Computer Science
JAVA: (Find yourself in PI)
In this assignment you will find a numeric string (if it exists) within a file containing the first 1 million characters of the decimal expansion of PI. The numeric string in question is a 6 character string representing your birth date. E.g., if your birth date is January 1, 1984, then the string is 010184. The file containing the first 1 million characters of the decimal expansion of PI is named pidigits.txt and is available for download from D2L.
Your code should prompt the user for their birthday and then verify that the string entered by the user is indeed a valid date string. Invalid date strings include the following:
013284 // No month has more than 31 days
022905 // 2005 was not a leap year 150184
// There are only 12 months 093196
// September only has 30 days etc.
Thus, a birth date string is of the form: mmddyy where mm is a two digit string representing the month, dd is a two digit string representing the day and yy is a two digit string representing the year. Once a birth date string has been entered by the user and validated, you will open pidigits.txt and read in a single character at a time using a BufferedReader instance. If a non-digit character such as a space, tab, or blank line is read, discard it. If the character is a digit character, “keep it” until a match/non-match has been established. As you read the characters, if there is a match between the birth date string and the characters read, report this to the user. Your code must find all such matches in the file, report all such matches to the user, report the character position in the file at which a given match begins, report the number of comparisons made in establishing the match, and report the total number of comparisons used in reading the entire file.. The format used for reporting is:
Your birthday 022348 was found at character position 1013664 in pidigits.txt The number of comparisons so far is: 919560 Your birthday 022348 was found at character position 1073634 in pidigits.txt The number of comparisons so far is: 973942 The total number of comparisons made in reading this file is: 1111091 If there are no matches for the birth date string, then your code should simply output the total number of comparisons made in reading the file.
Constraints:
Your must use BufferedReader for all IO. No Scanner instances nor JOptionPanes allowed. Failure to observe this constraint will result in a significant loss of points. Each character in pidigits.txt will be read in exactly once using the read() method of the BufferedReader class.
You must use the version of read() that takes no parameters. You do not need to “back up” and reread characters that have already been read. Failure to observe this constraint will result in a significant loss of points.
You are not allowed to store the characters read in an array or any other kind of container. They are to be stored in char variables only. It should be obvious that you need only 6 such variables for this assignment. Failure to observe this constraint will result in a significant loss of points.
You are not allowed to use any methods from the String class for finding matches. You may and should use the isDigit() method. The isDigit() method is a static method in the Character class. Failure to observe this constraint will result in a significant loss of points. Your code must validate that the birth date string entered by the user is indeed a valid date.
You must do this by passing the string as a parameter to a constructor of some sort of Date class. The Date class can be one that you build from scratch or can be based on one of the Date classes in the Java API (Calendar, GregorianCalendar, etc.). The code in your Date class is allowed to use methods from the String class. Failure to observe this constraint will result in a significant loss of points.
The name of the file containing your main() method must be YourFirstNameYourLastNameIV.java. The name of the file containing your code for your Date class must be BirthDate.java. Failure to observe this constraint will result in a significant loss of points.
In: Computer Science
Draw a hypothetical demand and supply curves for egg cups in Canada, and then graph and explain the following events and how they affect the equilibrium price and quantity of egg cups in Canada.
Suppose that country a population of 120 made up of a labour force of 100 and 20 children under the age of 15,
Eight members of the labour force are unemployed
Of the eight unemployed 2 worked in a factory that produced pies this factor has closed down and expected to open up after the pandemic.
One of the eight is a sky instructor and has been laid off for the summer
One of the unemployed cannot find a job and gives up looking
Name the two measurements of inflation discussed in class
1)
2)
Using 2012 as the base year (=100) calculate the inflation rate for 2013
|
Year |
Slices of Pizza |
Price per Slice |
Cans of Pepsi |
Price per Can |
|
2012 |
40 |
10 |
10 |
20 |
|
2013 |
60 |
12 |
20 |
24 |
What does currency depreciation mean?
Who is the only legal issuer of bank notes and coins in Canada?
A responsible government believes that the inflation rate is out of control, what fiscal policies could they enact?
4) Economic Growth
|
2017 |
2018 |
|||
|
Product |
Quantity |
Price |
Quantity |
Price |
|
Backpacks |
100 |
$10 |
120 |
$12 |
|
Books |
50 |
$15 |
40 |
$20 |
Using 2017 as a base year, calculate;
1) The GDP deflator
2) Nominal Economic growth
3) Real economic growth
4) Give reasons why Real GDP per capita may overstate the well-being of a countries inhabitants?
5) MATCHING
Match the terms on the right to the ones on the left by placing the appropriate CAPITAL letter on the space provided. All the phrases are designed to fit; some may fit more than once. In any case, provide only one answer for each term. Illegible answers will be marked as wrong.
In: Economics
In: Finance
A rich aunt has promised you $3,000 one year from today. Inaddition, each year after that, she has promised you a payment(on the anniversary of the last payment) that is 3% larger than the last payment. She will continue to show this generosity for 20 years, giving a total of 20 payments. If the interest rate is 8%, what is her promise worth today?
In: Finance
A police car sounding a siren with a frequency of 1550 Hz is traveling at 130 km/h .
What frequencies does an observer standing next to the road hear as the car approaches? As it recedes?
What frequencies are heard in a car traveling at 90.0 km/h in the opposite direction before and after passing the police car? For both approaching and receding
The police car passes a car traveling in the same direction at 80.0 km/h. What two frequencies are heard in this car? For both approaching and receding
In: Physics
state all null and alternative hypotheses and use the appropriate test statistic. Please use Minitab and show step by step. Finally, draw your conclusions based on the Minitab output
| Capsule | Week | betacar |
| 1 | one | 116 |
| 1 | one | 146 |
| 1 | one | 200 |
| 1 | one | 180 |
| 1 | one | 142 |
| 2 | one | 110 |
| 2 | one | 114 |
| 2 | one | 100 |
| 2 | one | 92 |
| 2 | one | 212 |
| 3 | one | 162 |
| 3 | one | 198 |
| 3 | one | 208 |
| 3 | one | 160 |
| 3 | one | 88 |
| 4 | one | 182 |
| 4 | one | 234 |
| 4 | one | 230 |
| 4 | one | 152 |
| 4 | one | 64 |
| 1 | nine | 190 |
| 1 | nine | 262 |
| 1 | nine | 334 |
| 1 | nine | 226 |
| 1 | nine | 268 |
| 2 | nine | 210 |
| 2 | nine | 250 |
| 2 | nine | 224 |
| 2 | nine | 350 |
| 2 | nine | 212 |
| 3 | nine | 472 |
| 3 | nine | 336 |
| 3 | nine | 416 |
| 3 | nine | 350 |
| 3 | nine | 226 |
| 4 | nine | 232 |
| 4 | nine | 566 |
| 4 | nine | 444 |
| 4 | nine | 180 |
| 4 | nine | 216 |
| 1 | two | 200 |
| 1 | two | 294 |
| 1 | two | 276 |
| 1 | two | 164 |
| 1 | two | 290 |
| 2 | two | 280 |
| 2 | two | 400 |
| 2 | two | 225 |
| 2 | two | 250 |
| 2 | two | 354 |
| 3 | two | 432 |
| 3 | two | 242 |
| 3 | two | 476 |
| 3 | two | 264 |
| 3 | two | 160 |
| 4 | two | 590 |
| 4 | two | 474 |
| 4 | two | 202 |
| 4 | two | 262 |
| 4 | two | 218 |
In: Statistics and Probability
A. Axillary B. femoral C. fibular D. obturator E. radial F. phrenic G. ulnar
______ Forms from the cervical plexus.
______ Damage to this nerve would prevent extension at the knee.
______ Stimulation of this nerve would trigger adduction at the hip.
______ Damage to this nerve might weaken flexion at the wrist.
A. ventral root B. ventral horn C. ventral ramus D. dorsal root E. dorsal horn F. dorsal ramus
______ Origin of somatic motor neurons.
______ Contains only sensory fibers.
______ Carries only fibers connecting to the central region of the back.
In: Anatomy and Physiology
Data structure
In: Computer Science
Data structure
In: Computer Science