Implement and test a TaskList application in Java that will allow a client to manage information about daily tasks. A task has a task name, is scheduled on a specific day of the week and can have a comment attached to it. Together, the task name and day uniquely identify a task. There may be tasks with the same name scheduled for different days of the week. The application should allow the client to start with an empty TaskList and then manage it by adding, deleting, searching and displaying information about tasks from the TaskList according to the specifications below.
Your application should offer the client a menu with the following operations:
0. Exit.
1. Add a task.
2. Delete a task on a specified day.
3. Delete a specified task.
4. Print content of TaskList.
5. Search day for tasks.
Here is the specification of the functionality of the TaskList application:
1. Add a task: Adds information about a task to the TaskList. Requests the following input from the client: day, task name, and comment. If there is already a task with this name scheduled for that week day, the task cannot be added and the user should be notified of this fact.
2. Delete a task on a specified day: Deletes a specified task on a specified day from the TaskList. Requests the following input from the client: task name and day. The user should be notified if there is no task with that name scheduled for that day in the TaskList.
3. Delete a specified task. Deletes a specified task from any day it may appear in the TaskList. Requests the following input from the client: task name. The user should be notified if there is no task with that name in the TaskList.
4. Display content of TaskList: Displays information about all tasks in the TaskList. Requests the following input from the client: None. For each task in the TaskList, displays task name, day it is scheduled on and comment attached to it.
5. Search day for tasks: Displays information about the tasks registered for a specified day. Requests the following input from the client: day.
Hint: Make sure that you use object oriented design in your solution. In future applications the TaskList class may be used in an application used to manage several clients’ task lists. You should be able to extend your design without changes to the TaskList.
In: Computer Science
1/Your team was asked to program a self-driving car that reaches its destination with minimum travel time.
Write an algorithm for this car to choose from two possible road trips. You will calculate the travel time of each trip based on the car current speed and the distance to the target destination. Assume that both distances and car speed are given.
2/
Write a complete Java program that do the following:
Note:Your program output should look as shown below.
My Name: Ameera Asiri
My student ID: 123456789
My Course Name: Computer Programming
My Course Code: CS140
My Course CRN: 12345
AIYSHA ASIRI
Note: Include the screenshot of the program output as a part of your answer.
3/
Write a tester program to test the mobile class defined below.
Create the class named with your id (for example: Id12345678) with the main method.
Your answer should include a screenshot of the output. Otherwise, you will be marked zero for this question.
public class Mobile {
private int id;
private String brand;
public Mobile() {
id = 0;
brand = "";
}
public Mobile(int n, String name) {
id = n;
brand = name;
}
public void setBrand(String w) {
brand = w;
}
public void setId(int w) {
id = w;
}
Public int getId() {
return id;
}
public String getBrand() {
return brand;
}
}
4/
Write a method named raiseSalary that accepts two integers as an argument and return its sum multiplied by 15%. Write a tester program to test the method. The class name should be your ID (for example: Id12345678).
Your answer should include a screenshot of the output. Otherwise, you will be marked zero for this question.
In: Computer Science
1/Your team was asked to program a self-driving car that reaches its destination with minimum travel time.
Write an algorithm for this car to choose from two possible road trips. You will calculate the travel time of each trip based on the car current speed and the distance to the target destination. Assume that both distances and car speed are given.
2/
Write a complete Java program that do the following:
Note:Your program output should look as shown below.
My Name: Ameera Asiri
My student ID: 123456789
My Course Name: Computer Programming
My Course Code: CS140
My Course CRN: 12345
AIYSHA ASIRI
Note: Include the screenshot of the program output as a part of your answer.
3/
Write a tester program to test the mobile class defined below.
Create the class named with your id (for example: Id12345678) with the main method.
Your answer should include a screenshot of the output. Otherwise, you will be marked zero for this question.
public class Mobile {
private int id;
private String brand;
public Mobile() {
id = 0;
brand = "";
}
public Mobile(int n, String name) {
id = n;
brand = name;
}
public void setBrand(String w) {
brand = w;
}
public void setId(int w) {
id = w;
}
Public int getId() {
return id;
}
public String getBrand() {
return brand;
}
}
4/
Write a method named raiseSalary that accepts two integers as an argument and return its sum multiplied by 15%. Write a tester program to test the method. The class name should be your ID (for example: Id12345678).
Your answer should include a screenshot of the output. Otherwise, you will be marked zero for this question.
In: Computer Science
accounting question
The following information has been extracted from the financial records of Associate Ltd at 1 April 2004 and at 31 March 2017.
|
Associate Ltd 1 April 2004 |
Associate Ltd 31 March 2017 |
|
|
$ |
$ |
|
|
Sales |
1 800 000 |
|
|
Less cost of goods sold |
1 200 000 |
|
|
Gross profit |
600 000 |
|
|
Less expenses |
328 400 |
|
|
Profit before tax |
271 600 |
|
|
Plus rental income |
26 000 |
|
|
Less income tax expense |
71 880 |
|
|
Profit after tax |
225 720 |
|
|
Retained earnings- opening balance |
230 500 |
|
|
Less dividends declared |
100 000 |
|
|
Balance sheet balances: |
||
|
Share capital |
450 000 |
450 000 |
|
Retained earnings – closing balance |
220 000 |
356 220 |
|
Asset revaluation surplus |
70 000 |
82 000 |
|
Accounts payable |
85 600 |
158 000 |
|
Dividends payable |
- |
40 000 |
|
Other liabilities |
474 400 |
876 220 |
|
Total equity and liabilities |
$1 300 000 |
$2 100 000 |
|
Accounts receivable |
130 000 |
205 000 |
|
Inventory |
90 000 |
107 000 |
|
Other assets |
80 000 |
90 000 |
|
Property, plant and equipment |
1 000 000 |
1 698 000 |
|
Total assets |
$1 300 000 |
$2 100 000 |
Additional information provided:
(i) Investor Ltd acquired 20% the equity in Associate Ltd on 1 April 2004 for $350 000 cash.
(ii) Each financial year Investor Ltd has been paying Associate Ltd an office rental fee of $26 000.
(iii) Investor Ltd records dividend income from Associate Ltd when it is declared by Associate Ltd.
(iv) During March 2016 Associate Ltd made an upward sale to Investor Ltd of $32 000 and recognised a profit of $10 560. This purchase of inventory remained in Investor Ltd’s inventory as at 31 March 2016.
.
(v) During March 2017 Associate Ltd made an upward sale to Investor Ltd of $40 000 and
recognised a profit of $13 200. Investor Ltd did not sell this purchase of inventory until
14 May 2017.
(vi) During March 2016 Investor Ltd made a downward sale to Associate Ltd of $8 000 and
recognised a profit of $2 400. This purchase remained in Associate Ltd’s inventory as at 31
March 2016.
(vii) During March 2017 Investor Ltd made a downward sale to Associate Ltd of $5 000 and
recognised a profit of $2 000. Associate Ltd sold this inventory before the 2017 financial year
end.
(viii) The tax rate is 28%.
Required:
(a) State the amount at which the asset Investment in Associate will be measured at in the
general ledger of Investor Ltd as at 31 March 2017.
(b) Prepare the notional journal entry, as at 31 March 2017, to account for the asset
Investment in Associate using the equity method as required by
NZ IAS 28 Investments in
Associates
. Show all workings in the notional journal entry.
Complete a ‘quick estimate’ in the
space provided.
(c) Determine the amount at which the asset Investment in Associate will be measured at,
after being equity accounted for, in the financial statements as at 31 March 2017. Show
workings.
|
(a) Investment in Associate general ledger amount: |
$ |
|
(b) The equity method notional journal entry as at 31 March 2017: All workings must be shown clearly on each line of your notional journal entry. If necessary round up or down to the nearest whole dollar. |
||
|
$ |
$ |
|
|
Workings for the ‘quick estimate’: |
|
(c) Investment in Associate after being equity accounted for: |
$ |
|
All workings must be shown: |
|
In: Accounting
In: Nursing
In: Nursing
|
Employee ID |
First Name |
Last Name |
|
Title |
Address |
Extension |
Department |
Department ID |
Hiring Date |
Department Phone # |
|
0001 |
John |
Smith |
jsmith |
Accountant |
1300 West st |
5775 |
Accounting |
2100 |
8/1998 |
407-366-5700 |
|
0002 |
Brian |
Miller |
badams |
Admin Assistant |
1552 Palm dr |
5367 |
Human resource |
2300 |
4/1995 |
407-366-5300 |
|
0003 |
James |
Miller |
miller |
Inventory Manager |
2713 Buck rd |
5432 |
Production |
2520 |
8/1998 |
407-366-5400 |
|
0004 |
John |
Jackson |
jackson_sam |
Sales Person |
433 tree dr |
5568 |
Sales |
2102 |
6/1997 |
407-366-5500 |
|
0005 |
Robert |
Davis |
Davis |
Manager |
713 corner st |
5642 |
Production |
2520 |
1/2001 |
407-366-5400 |
|
0006 |
Paul |
Thompson |
thompsonp |
Market Analyst |
205 Bridge dr |
5744 |
Marketing |
2101 |
5/2003 |
407-366-5600 |
|
0007 |
Sandy |
Davis |
SDavis |
Manager |
713 Corner st |
5702 |
Accounting |
2100 |
11/1999 |
407-366-5700 |
1. List the major entities identified in the table above
2. After examining the table carefully identify candidate keys. Remember from the lecture that a candidate key field has to be unique, but should not hold private information that might compromise person's identity. For example SSN is unique and can be used to determine student information, so it is a candidate key, but using SSN might compromise student security for that it will not be used as primary key. The combination of first name and last name is not unique and cannot be used as a candidate key. Once the candidate keys been identified, some will be as primary keys and will be used to normalize the table. To connect the tables, the primary key of one table can be used as a foreign key in the other.
In: Computer Science
Complete the following problems using R. Name the file with your last name, e.g., “Prob set 6-Smith.eoc”Clearly label problems, and be sure to turn in explanations and interpretations where appropriate.
3.Total cholesterol has been reported to be 200 mg/dL on average in the US by the Centers for Disease Control. You measure total cholesterol on a random sample of 80 Alabama adults, with the intention of comparing Alabamians’ cholesterol level to that of the US average. Data are included in the assignment .xlsx file. Assume
that cholesterol is approximately normally distributed with a known standard deviation of 70 mg/dL.
a.What is the mean value observed for Alabamians’ cholesterol?
b.What is the standard error of Alabamians’ cholesterol assuming the given known standard deviation?
c.Find the 95% confidence interval for the unknown population mean of Alabamians’ cholesterol level values and interpret its meaning.
d.Test the hypothesis that Alabamians have higher average cholesterol than that of the US at the =0.05 level. (Be sure to right down all steps, as in the lecture notes, and interpret the meaning of the test!)
e.How would your answer in (d) change if you used an =0.01 level?
| 116 |
| 282 |
| 213 |
| 252 |
| 150 |
| 219 |
| 221 |
| 289 |
| 226 |
| 265 |
| 234 |
| 256 |
| 208 |
| 263 |
| 155 |
| 206 |
| 201 |
| 283 |
| 208 |
| 142 |
| 279 |
| 155 |
| 231 |
| 143 |
| 218 |
| 243 |
| 162 |
| 125 |
| 212 |
| 149 |
| 250 |
| 184 |
| 210 |
| 236 |
| 241 |
| 294 |
| 196 |
| 226 |
| 184 |
| 208 |
| 278 |
| 144 |
| 263 |
| 245 |
| 212 |
| 205 |
| 208 |
| 151 |
| 266 |
| 224 |
| 276 |
| 203 |
| 222 |
| 199 |
| 272 |
| 197 |
| 176 |
| 241 |
| 269 |
| 217 |
| 206 |
| 239 |
| 238 |
| 237 |
| 187 |
| 203 |
| 283 |
| 156 |
| 283 |
| 138 |
| 234 |
| 198 |
| 172 |
| 277 |
| 172 |
| 157 |
| 267 |
| 160 |
| 243 |
| 189 |
In: Math
Can someone covert the code into C language
#include<iostream>
#include<iomanip>
#include<ios>
using namespace std;
/********************************************************************************
Function name: main
Purpose:
main function
In parameters: b,r,i
Out paramters: trun,error,total,value
Version:
1.0
Author:
********************************************************************************/
void main()
{
int i;//declaring this variable to get value for
quitting or calaculating series
do {//do while loop to calaculate series until user
quits
cout << "Enter 1 to evaluate
the series." << endl;
cout << "Enter 2 to quit"
<< endl << endl;
cin >> i;
if (i == 2)
{
cout <<
"Exiting..." << endl;
exit(0);
}
else if (i < 1 || i> 2 )//if
the user enters any value except 1 or 2
{
cout <<
"Please enter a valid input." << endl;
}
else
{
double
b;//declared so user will enter proper number of terms
do {//do while
loop to ensure user enters proper number of terms
cout << "Please enter the number of
(non-zero) terms in the series (1,2,3,4,5,6)." << endl;
cin >> b;
cout << endl;
if (b < 1 || b>6)//if the user entered a
number that was not between 1-6
cout << "Incorrect
number of terms." << endl;
} while (b <
1 || b>6);
double
r;//declared to get range in between 0 and 0.9.
do {
cout << "Please enter the range of B to
evaluate in increments (0.0 < B >=0.9)." << endl;
cin >> r;
if (r < 0.1 || r>0.9)//if entered number
was smaller than 0 or greater than 0.9
cout << "Incorrect
range." << endl;
} while (r <
0.1 || r>0.9);
cout <<
endl;
cout <<
"MACLAURIN SERIES " << endl;
cout << "
B V(B) Series V(B) Exact Relative Error %RSerE" <<
endl;
cout << "0
1 1 0 0" << endl;
for (double x =
r / 10; x <= r; x = x + r / 10)//this loop while calculate
series in 10 increments
{
double value = 1 / sqrt(1 - (x *
x));//calculating exact value of series
double total = 1;//variable to hold total of
series,adding 1 because first value of series will always be
1
for (int j = 2; j <= b; j++)//calculating
each term in the series
{
if (j == 2)
{
total +=
(x * x) / 2;//factorials have already been calcuated and each term
has been simplified,here we are adding value of each term
}
else if (j == 3)
{
total +=
(x * x * x * x * 3) / 8;
}
else if (j == 4)
{
total +=
(x * x * x * x * x * x * 5) / 16;
}
else if (j == 5)
{
total +=
(x * x * x * x * x * x * x * x * 35) / 128;
}
else if (j == 6)
{
total +=
(x * x * x * x * x * x * x * x * x * x * 63) / 256;
}
}
double error = (value - total) /
value;//calcuating relative error
double trun = 0;//variable to hold truncative
error
if (b + 1 == 2)//these if statements will sue
the first truncative term to find truncative error
{
trun = (x * x) / 2;
trun = trun * 100 /
value;
}
else if (b + 1 == 3)
{
trun = (x * x * x * x * 3) /
8;
trun = trun * 100 /
value;
}
else if (b + 1 == 4)
{
trun = (x * x * x * x * x * x
* 5) / 16;
trun = trun * 100 /
value;
}
else if (b + 1 == 5)
{
trun = (x * x * x * x * x * x
* x * x * 35) / 128;
trun = trun * 100 /
value;
}
else if (b + 1 == 6)
{
trun = (x * x * x * x * x * x
* x * x * x * x * 63) / 256;
trun = trun * 100 /
value;
}
else
{
trun = (x * x * x * x * x * x
* x * x * x * x * x * x * 10395) / 46080;
trun = trun * 100 /
value;
}
printf("%g", x);//print each increment
std::cout << std::fixed;//so the values
wont be rounded
std::cout << std::setprecision(10);//so
the output of each double will be to 10 decimal place
cout << " " << total << " "
<< value << " ";
std::cout << std::defaultfloat;//to get
output in scientific as well as non scientific if required
cout << error << " ";
cout << trun << endl;
}
cout <<
endl;
}
} while (i != 2);//this loop will end when user
presses 1
}
In: Computer Science
It have a lot of error. please see it and solve it for me. run it please. Thank you a lot.
#define MAXWORDLENGTH 20
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "getline.inc"
struct entry {
char name[81];
};
struct entry part;
struct tnode {
char *name;
int record_number;
struct tnode *left;
struct tnode *right;
};
void lookup(struct tnode *root,char *s);
void treeprint2(struct tnode *root,char *searchkey);
int c;
int n;
FILE *stream;
struct tnode *root, *tree(struct tnode *, char *, int),*dtree(struct tnode *, char *);
void main()
{
char searchkey[81];
char name[MAXWORDLENGTH];
int i=0;
root=NULL;
stream = fopen("data.bin","r+b");
for (;;) {
//printf("enter a name or 'exit' to quit.... ");
//getline(name,81);
//scanf(" %[^\n]",name);
n=fread(&part,sizeof(part),1,stream);
if(!n) break;
//if (stricmp(name,"exit")==0) break;
//root=tree(root,name,i++);
root = tree(root,part.name,i++);
}
treeprint(root);
for(;;){
printf("\n\n\t enter the name to delete or exit");
scanf(" %[^\n]",searchkey);
if(stricmp(searchkey,"exit")==0) break;
root=dtree(root,searchkey);
treeprint(root);
}
for(;;){
printf("\n\n\t enter the name to lookup or exit");
scanf(" %[^\n]",searchkey);
if(stricmp(searchkey,"exit")==0) break;
lookup(root,searchkey);
}
fclose(stream);
}//main
struct tnode *tree(struct tnode *p,char *w,int w2)
{
struct tnode *talloc();
char *strsave(char *);
int cond;
if (p== NULL) {
p=talloc();
p->name=strsave(w);
p->record_number=w2;
p->left=p->right=NULL;
} else if ((cond=stricmp(w,p->name)) ==0)
//printf("\7 duplicate entry !!!!!! \n");
p->right=tree(p->right,w,w2);
else if (cond<0)
p->left=tree(p->left,w,w2);
else
p->right=tree(p->right,w,w2);
return(p);
}// tree
treeprint(struct tnode *root)
{
if (root) {
treeprint(root->left);
printf("\n\n %s %d",root->name,root->record_number);
treeprint(root->right);
}//if
}// treeprint
struct tnode *talloc()
{
return((struct tnode *) malloc(sizeof(struct tnode)));
}
char *strsave(char *s)
{
char *p;
if ((p=malloc(strlen(s)+1)) != NULL)
strcpy(p,s);
return(p);
}
struct tnode *dtree(struct tnode *root,char *searchkey)
{struct tnode *p,*p2;
if (root){
if (stricmp(root->name,searchkey)==0) {
if (root->left == root->right) {free(root);return(NULL);}
else if (root->left==NULL) {p=root->right;free(root);return(p);}
else if (root->right==NULL) {p=root->left;free(root);return(p);}
else {
p2=root->right;
p=root->right;
while(p->left) p=p->left;
p->left=root->left;
free(root);
return(p2);
}
}
if (stricmp(root->name,searchkey) < 0) root->right=dtree(root->right,searchkey);
else root->left=dtree(root->left,searchkey);
return(root);
}
else {printf("\n\n\t\a %s not found !!!\n\n",searchkey);return(NULL);}
}//treedel
void lookup(struct tnode *p,char *s)
{
if(!p)
{printf("\n\a %s not found",s);return;}
else if (strncmpi(s,p->name,strlen(s))==0)
{
fseek(stream,p->record_number *sizeof(part),0);
fread(&part,sizeof(part),1,stream);
printf("\n %s %d",part.name,p->record_number);
puts("\n (y) or (n)????");
fflush(stdin);
c = getchar();
fflush(stdin);
if(c!='y')
//lookup(p->right,s);
treeprint2(p->right,s);
}//else
else if (strncmpi(s,p->name,strlen(s))<0)
lookup(p->left,s);
else lookup(p->right,s);
}//lookup
void treeprint2(struct tnode *root,char *searchkey)
{
if (root) {
treeprint2(root->left,searchkey);
if (strncmpi(searchkey,root->name,strlen(searchkey))==0) printf("\n\n %s %d",root->name,root->record_number);
treeprint2(root->right,searchkey);
}//if
}// treeprint
It have a lot of error. please see it and solve it for me. Thank you a lot.
In: Computer Science