A wheel of radius b is rolling along a muddy road with a speed v. Particles of mud attached to the wheel are being continuously thrown off from all points of the wheel. If v2 > 2bg, where g is the acceleration of gravity, find the maximum height above the road attained by the mud, H = H(b,v,g).
In: Physics
The drag force on a large ball that weighs 200 g in free flight is given by FD = 2*10 V , where FD is in Newtons and V is in meters per second. If the ball is dropped from rest 300 m above the ground, determine the speed at which it hits the ground. What percentage of the terminal speed is the result?
In: Mechanical Engineering
On January 1, 2008, Davis Corporation issued $3,000,000 of 8% bonds at 101. Interest is paid annually on December 31 of each year. The bonds mature on December 31, 2027, and the company uses the straight-line method of amortization. On January 2, 2016, Davis reacquired the bonds and recognized a loss of $91,000.
Prepare the journal entry to record the reacquisition of Davis’s bonds on January 2, 2016.
Calculate the reacquisition price of the bonds on January 2, 2016.
In: Accounting
(1) (5 pts) What are the differences between nominal GDP and real GDP? (2) (5 pts) Suppose the real GDP in 2016 is 1 trillion dollar and the real GDP in 2017 is 1.2 trillion dollar, what is the growth rate of the real GDP from 2016 to 2017? (3) (5 pts) Suppose the nominal GDP growth rate is 15% from 2016 to 2017, what is the inflation rate measured by the GDP deflator,(i.e. inflation rate)?
In: Economics
In your work as an accountant you advise a client, Avon Pty. Ltd. (Avon), on various matters. Avon entered into a $500,000 one year contract in June 2016 with Central Queensland University (a registered Research Service Provider) to undertake research and development for Avon. The contract was to run from July 2016 to June 2017. Avon wants your advice about tax offsets and how this expense could be treated by the ATO in the 2016-17 tax year.
In: Accounting
The bounded buffer problem is a producer-consumer problem where a producer process adds new items to a shared buffer and a consumer process consumes items from that buffer (in the first-in-first-out (FIFO) order). When a producer adds a new item, the buffer size grows by one, and whenever a consumer consumes an item from the buffer, the size is reduced by one. The producer process must wait when the buffer is full likewise the consumer process must wait when the buffer is empty. You are to implement the bounded buffer (bb) problem using semaphores using POSIX APIs.
Use the following code:
// Synchronization tools
// Bounded buffer program with semaphores
// Author name: _______________________
// Author email: ___________________
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/shm.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <semaphore.h>
#include <unistd.h>
#include <sys/wait.h>
const int SIZE = 4;
int __item = 1001;
int IN;
int OUT;
int *count;
int *buffer;
void init() {
// TODO: Create semaphores
// Creating shared memory
int shm_fd = shm_open("PROD_CONS", O_CREAT | O_RDWR, 0666);
ftruncate(shm_fd, 4096);
int *sbuf = (int *)mmap(0, 4096, PROT_WRITE, MAP_SHARED, shm_fd, 0);
count = sbuf;
buffer = sbuf + 1;
*count = 0;
IN = OUT = 0;
}
/* Generate a new item */
int generate_new_item() {
return __item++;
}
void write_buffer() {
//TODO: Put new_item into the buffer
int new_item = generate_new_item();
printf("Writing value, current buffer size %d\n",*count);
}
void read_buffer() {
// TODO: read an item from the buffer
printf("Reading value, current buffer size %d\n", *count);
}
void producer() {
for (int i = 0; i < 10; i++) {
printf("PRODUCER:: ");
write_buffer();
sleep(2);
}
}
void consumer() {
for (int i = 0; i < 10; i++) {
printf("\t\tCONSUMER:: ");
read_buffer();
sleep(1);
}
}
int main(void) {
printf("Bounded buffer program\n");
init();
int pid = fork();
if (pid < 0) {
exit(0);
}
else if (pid == 0) {
consumer();
exit(0);
}
else if (pid > 0) {
producer();
wait(NULL);
// Unlink shared memory
shm_unlink("PROD_CONS");
// TODO: unlink the semaphores
exit(0);
}
return 0;
}
The skeleton code starts two processes (one as a producer and the other one as a consumer). A shared buffer (called "buffer") is created and the shared variable "count" counts the number of items in the buffer (the maximum allowed buffer size is defined by a const int SIZE, set to 4). Your task is to complete read_buffer() and write_buffer() functions (marked by TODO).
NOTE that you need to update IN, OUT, and count variables as items are added and removed from the buffer. You also need to add appropriate semaphore calls around those updates for proper synchronization.
Refer to Figure 7.1 (producer process) and Figure 7.2 (consumer process) in the textbook for details.
In: Computer Science
Amortization of Prior Service Cost
On January 1, 2016, Baznik Company adopted a defined benefit pension plan. At that time, Baznik awarded retroactive benefits to certain employees. These retroactive benefits resulted in a prior service cost of $1,200,000 on that date (which it did not fund). Baznik has six participating employees who are expected to receive the retroactive benefits. Following is a schedule that identifies the participating employees and their expected years of future service as of January 1, 2016:
|
Employee |
Expected Years of Future Service |
| A | 1 |
| B | 3 |
| C | 4 |
| D | 5 |
| E | 5 |
| F | 6 |
Baznik decided to amortize the prior service cost to pension expense using the years-of-future-service method. The following are the amounts of the components of Baznik’s pension expense, in addition to the amortization of the prior service cost for 2016 and 2017:
|
2016 |
2017 |
|
| Service cost | $397,300 | $567,423 |
| Interest cost on projected benefit obligation | 104,100 | 150,337 |
| Expected return on plan assets | — | 90,300 |
Baznik contributed $772,700 and $875,300 to the pension fund at the end of 2016 and 2017, respectively.
Required:
| 1. | Next Level Prepare a set of schedules for Baznik to determine (a) the amortization fraction for each year and (b) the amortization of the prior service cost. |
| 2. | Next Level Prepare all the journal entries related to Baznik’s pension plan for 2016 and 2017. |
General Journal
Prepare the entries to record the prior service cost on January 1, 2016, and the pension expense and amortization of prior service costs on December 31, 2016 and 2017.
PAGE 2016PAGE 2017
GENERAL JOURNAL
| DATE | ACCOUNT TITLE | POST. REF. | DEBIT | CREDIT | |
|---|---|---|---|---|---|
|
1 |
|||||
|
2 |
|||||
|
3 |
|||||
|
4 |
|||||
|
5 |
|||||
|
6 |
|||||
|
7 |
Next Level
Prepare a set of schedules for the Baznik Company to determine the amortization fraction for each year. Additional Instruction
|
BAZNIK COMPANY |
|
Amortization Fractions |
|
2016 - 2021 |
|
1 |
Employee |
Expected Years of Future Service |
Number of Service Years Rendered 2016 |
Number of Service Years Rendered 2017 |
Number of Service Years Rendered 2018 |
Number of Service Years Rendered 2019 |
Number of Service Years Rendered 2020 |
Number of Service Years Rendered 2021 |
|
2 |
A |
|||||||
|
3 |
B |
|||||||
|
4 |
C |
|||||||
|
5 |
D |
|||||||
|
6 |
E |
|||||||
|
7 |
F |
|||||||
|
8 |
Total |
|||||||
|
9 |
Amortization fraction |
Prepare a set of schedules for the Baznik Company to determine the amortization of the prior service cost. Additional Instruction
|
BAZNIK COMPANY |
|
Prior Service Cost Amortization |
|
2016 - 2021 |
|
1 |
Year |
Total Prior Service Cost |
Amortization Fraction |
Amortization to Increase Pension Expense |
Remaining Prior Service Cost |
|
2 |
2016 |
||||
|
3 |
2017 |
||||
|
4 |
2018 |
||||
|
5 |
2019 |
||||
|
6 |
2020 |
||||
|
7 |
2021 |
In: Accounting
1.The below code has some errors, correct the errors and post the working code.
Scanner console = new Scanner(System.in);
System.out.print("Type your name: ");
String name = console.nextString();
name = toUpperCase();
System.out.println(name + "
has " + name.Length() + " letters");
Sample Ouptut:
Type your name: John
JOHN has 4 letters
2. Write a code that it reads the user's first and last name (read in the entire line as a single string), then print the last name followed by a comma and the first initial.
Sample output:
Type your name: John Smith
Smith, J.
In: Computer Science
At a university, students are assigned a system user name, which is used to log into the campus computer network system. As part of your internship with the university's IT department, your assignment is to write the code that generates system user names for students.
You will use the following logic to generate a user name:
Get the first three characters of the student's first name. (If the first name is less than three characters use the entire first name.)
Get the first three characters of the student's last name. (If the last name is less than three characters use the entire last name)
Get the last three characters of the student's ID number. (If the ID number is less than three characters, use the entire ID number.)
Concatenate the three sets of characters to generate the user name.
For example, if a student’s name is Yogi Bear, and his ID number is T0017258, his login name would be YogBear721.
In main, obtain the student’s first name, last name and ID number, then call a function named get_login_name that accepts the student's first name, last name, and ID number as arguments and returns the student's login name as a string.
Next, in main, ask the student to generate a password then call a function to verify that it is correct. Passwords must adhere to the following rules:
A valid password must be at least seven characters in length,
Must have at least one uppercase letter, one lowercase letter, and one digit.
python programme
In: Computer Science
The code following is what I have so far. It does not meet my requirements. My problem is that while this program runs, it doesn't let the user execute the functions of addBook, isInList or compareLists to add, check, or compare. Please assist in correcting this issue. Thank you!
Write a C++ program to implement a singly linked list of books. The book details should include the following: title, author, and ISBN. The program should include the following functions:
#include <iostream>
#include <string>
using namespace std;
struct Book {
string title;
string author;
string isbn;
Book(string t, string a, string is)
{
title = t;
author = a;
isbn = is;
}
Book* next;
};
class BookList {
private:
Book* head;
public:
BookList();
void addBook(Book* b);
bool isInList(string isbn);
bool compareLists(BookList& other);
};
BookList::BookList()
{
head = NULL;
}
void BookList::addBook(Book* b)
{
b->next = head;
head = b;
}
bool BookList::isInList(string isbn)
{
Book* temp = head;
while (temp != NULL) {
if (temp->isbn == isbn) {
return true;
}
temp = temp->next;
}
return false;
}
bool BookList::compareLists(BookList& other)
{
Book* temp = head;
while (temp != NULL) {
if (!other.isInList(temp->isbn)) {
return false;
}
temp = temp->next;
}
return true;
}
int main()
{
BookList list1, list2;
list1.addBook(new Book("title1", "author1", "isbn1"));
list1.addBook(new Book("title2", "author1", "isbn2"));
list1.addBook(new Book("title1", "author2", "isbn3"));
list1.addBook(new Book("title3", "author3", "isbn4"));
list2.addBook(new Book("title1", "author1", "isbn1"));
list2.addBook(new Book("title2", "author1", "isbn2"));
list2.addBook(new Book("title1", "author2", "isbn3"));
list2.addBook(new Book("title4", "author4", "isbn5"));
cout << "list1.isInList(\"isbn4\")" <<
list1.isInList("isbn4") << endl;
cout << "list1.isInList(\"isbn5\")" <<
list1.isInList("isbn5") << endl;
cout << "list1.isInList(\"isbn2\")" <<
list1.isInList("isbn2") << endl;
cout << "list1.compareLists(list2)" <<
list1.compareLists(list2) << endl;
return 0;
}
In: Computer Science