Blog

Coursehelp
April 20, 2019
QUESTION : No Comments

(Solved) : Coding Language C Implement Class Person Following Fields Name Pointer Person S Best Frien Q27364717 . . .

The coding language is C++

Implement a class Person with the following fields:

– the name

– a pointer to the person’s best friend (a Person*)

– a popularity counter that indicates how many other people havethis person as their best friend

Write a program that reads in a list of names, allocates a newPerson for each of them, and stores them in avector<Person*>. Then ask the name of the bestfriend for each of the Person objects. Locate the object matchingthe friend’s name and call a set_best_friend memberfunction to update the pointer and counter. Finally, print out allPerson objects, listing the name, besr friend, and popularitycounter for each.

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Program C Problem 713 Write Program Reads Lines Text Appends Char Buffer 1000 Stop Q27528046 . . .

The coding program is C++
Problem 7.13
Write a program that reads lines of text and appends then to achar buffer [1000]. Stop after reading 1,000 characters. As youread in the text, replace all newline characters ‘n’ with ‘ ’terminators. Establish an array car* lines[1000], so that thelingers knthst addau point to the beginnings of the lines in thetext. Only consider 100 input lines if the input has more lines.Then display the lines in reverse order, starting with the lastinput.

all T-Mobile 11:58 PM ccle.ucla.edu (3) Problem P7.13 * Comment#1: Use get line to read in the text. After each line is read in. ask tbe user if more text is expected yn). fy then read in the next line, otherwise stop the input. Do not let the input to be more than 100 lins. If the b affer maximum capacity 1000 reached then stop the inpat. Also, if a line canmot be placed into the buffer without being eut, then stop the input. See the sample of inpat-outpat for details * Cotiaiwan 2: Note please that replacing-n with 0 whea ote appends lites into buffer is not necessary, Here is the reason for that. The getline function removes the newr line character .p after it reads in the line. In addition, to append the content of the ring used in getline to buffez one may to use the function strcpy or stropy.s which only deals with C-style string. The method of the string elus that returns C-style string, called c.atr will automatically add ? to the C-style string. Submit the solution in the file mae hmw.6.3cpp Sam km reversed order: HOMEWORK 6-DEADLINE MARCH 16, 11:59 PMall T-Mobile 11:58 PM ccle.ucla.edu (3) Problem P7.13 * Comment#1: Use get line to read in the text. After each line is read in. ask tbe user if more text is expected yn). f”y” then read in the next line, otherwise stop the input. Do not let the input to be more than 100 lins. If the b affer maximum capacity 1000 reached then stop the inpat. Also, if a line canmot be placed into the buffer without being eut, then stop the input. See the sample of inpat-outpat for details * Cotiaiwan 2: Note please that replacing-n’ with” 0′ whea ote appends lites into buffer is not necessary, Here is the reason for that. The getline function removes the newr line character .p after it reads in the line. In addition, to append the content of the ring used in getline to buffez one may to use the function strcpy or stropy.s which only deals with C-style string. The method of the string elus that returns C-style string, called c.atr will automatically add ? to the C-style string. Submit the solution in the file mae hmw.6.3cpp Sam km reversed order: HOMEWORK 6-DEADLINE MARCH 16, 11:59 PM Show transcribed image text all T-Mobile 11:58 PM ccle.ucla.edu (3) Problem P7.13 * Comment#1: Use get line to read in the text. After each line is read in. ask tbe user if more text is expected yn). f”y” then read in the next line, otherwise stop the input. Do not let the input to be more than 100 lins. If the b affer maximum capacity 1000 reached then stop the inpat. Also, if a line canmot be placed into the buffer without being eut, then stop the input. See the sample of inpat-outpat for details * Cotiaiwan 2: Note please that replacing-n’ with” 0′ whea ote appends lites into buffer is not necessary, Here is the reason for that. The getline function removes the newr line character .p after it reads in the line. In addition, to append the content of the ring used in getline to buffez one may to use the function strcpy or stropy.s which only deals with C-style string. The method of the string elus that returns C-style string, called c.atr will automatically add ? to the C-style string. Submit the solution in the file mae hmw.6.3cpp Sam km reversed order: HOMEWORK 6-DEADLINE MARCH 16, 11:59 PM

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Matlab Q30580758 . . .

Coding for Matlab

Show transcribed image text

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Language Python Data Set Available Http Wwwmediafirecom File 4w57944oi8pkbj4 Riding Q36572984 . . .

[Coding Language is Python]

Data Set available here:http://www.mediafire.com/file/4w57944oi8pkbj4/RidingMowers.xlsx/file

Assignment: KNN classification: Using the dataset fromthe class exercise, write a loop that analyzes ‘uniform’ and’distance’ weighting models for odd k values between 1 and 10 andprints the characteristics of the best model (i.e., k and weightingscheme) as well as its performance measures. Submit a screenshot ofyour code and its output.

[Exercise Code included below]:

In [1]”

import pandas as pd

In [2]:

df = pd.read_excel(‘RidingMowers.xlsx’, ‘Data’)

In [3]:

df

Out[3]:

Income Lot_Size Ownership
0 60.0 18.4 Owner
1 85.5 16.8 Owner
2 64.8 21.6 Owner
3 61.5 20.8 Owner
4 87.0 23.6 Owner
5 110.1 19.2 Owner
6 108.0 17.6 Owner
7 82.8 22.4 Owner
8 69.0 20.0 Owner
9 93.0 20.8 Owner
10 51.0 22.0 Owner
11 81.0 20.0 Owner
12 75.0 19.6 Nonowner
13 52.8 20.8 Nonowner
14 64.8 17.2 Nonowner
15 43.2 20.4 Nonowner
16 84.0 17.6 Nonowner
17 49.2 17.6 Nonowner
18 59.4 16.0 Nonowner
19 66.0 18.4 Nonowner
20 47.4 16.4 Nonowner
21 33.0 18.8 Nonowner
22 51.0 14.0 Nonowner
23 63.0 14.8 Nonowner

In [4]:

X = df.iloc[:, 0:2]from sklearn.preprocessing import LabelBinarizerenc = LabelBinarizer() y = enc.fit_transform(df.Ownership)[:, 0]from sklearn.model_selection import train_test_splitX_train, X_test, y_train, y_test = train_test_split(X, y, test_size = .25, random_state=20, stratify=y )

In [5]:

from sklearn import neighborsfrom pandas_ml import ConfusionMatrixfor weights in [‘uniform’, ‘distance’]: clf = neighbors.KNeighborsClassifier(9, weights=weights) clf.fit(X_train, y_train) y_pred = clf.predict(X_test) cm = ConfusionMatrix(y_test, y_pred) print(cm) cm.print_stats() print(‘———————————‘)Predicted False True __all__Actual False 3 0 3True 2 1 3__all__ 5 1 6population: 6P: 3N: 3PositiveTest: 1NegativeTest: 5TP: 1TN: 3FP: 0FN: 2TPR: 0.3333333333333333TNR: 1.0PPV: 1.0NPV: 0.6FPR: 0.0FDR: 0.0FNR: 0.6666666666666666ACC: 0.6666666666666666F1_score: 0.5MCC: 0.4472135954999579informedness: 0.33333333333333326markedness: 0.6000000000000001prevalence: 0.5LRP: infLRN: 0.6666666666666666DOR: infFOR: 0.4———————————Predicted False True __all__Actual False 3 0 3True 2 1 3__all__ 5 1 6population: 6P: 3N: 3PositiveTest: 1NegativeTest: 5TP: 1TN: 3FP: 0FN: 2TPR: 0.3333333333333333TNR: 1.0PPV: 1.0NPV: 0.6FPR: 0.0FDR: 0.0FNR: 0.6666666666666666ACC: 0.6666666666666666F1_score: 0.5MCC: 0.4472135954999579informedness: 0.33333333333333326markedness: 0.6000000000000001prevalence: 0.5LRP: infLRN: 0.6666666666666666DOR: infFOR: 0.4———————————/anaconda3/lib/python3.7/site-packages/pandas_ml/confusion_matrix/bcm.py:330: RuntimeWarning: divide by zero encountered in double_scalars return(np.float64(self.TPR) / self.FPR)/anaconda3/lib/python3.7/site-packages/pandas_ml/confusion_matrix/bcm.py:330: RuntimeWarning: divide by zero encountered in double_scalars return(np.float64(self.TPR) / self.FPR)

Description of Performance Measures
Population
Condition positive
Condition negative
Test outcome positive
Test outcome negative
TP: True Positive
TN: True Negative
FP: False Positive
FN: False Negative
TPR: Sensivity
TNR=SPC: Specificity
PPV: Pos Pred Value = Precision
NPV: Neg Pred Value
FPR: False-out
FDR: False Discovery Rate
FNR: Miss Rate
ACC: Accuracy
F1 score
MCC: Matthews correlation coefficient
Informedness
Markedness
Prevalence
LR+: Positive likelihood ratio
LR-: Negative likelihood ratio
DOR: Diagnostic odds ratio
FOR: False omission rate

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Problem 5111 Advanced External Resource 10 Points Possible 0opy Burrito Class Last Q30515717 . . .

Coding Problem 5.1.11 (Advanced) (External resource) (1.0 points possible) ? #0opy your Burrito class from the last exercise. Below, Console output will be displayed 2We ve given you three additional classes named Meat 3 Rice and Beans.Weve gone ahead and built getters 4 and setters in these classes to check if the incoming here 5 values are valid, so youll be able to remove those 6 from your original code. 7 class Burrito: def init (self, meat, to go, rice, beans, extra neat-False, guacamole-False, cheese-Faise, Ico-Faise, corn-False): self.set meat (meat) self.set to goto go selt.set rice (rice self.set beans (beans) self.set extra meat (extra meat) self.set guacamole(guacamole) self.set cheese (cheese) self.set_pico(pico) self.set corn (corn) 10 12 13 15 17 18 def get meat (self): def qet to go(self): def get_rice(self) def getbeans (self): def get_extra meat (self): def get guacamole(self) def get cheese (self): def get_pico(self): def get corn (self) 20 return self.meat return self.to gO return self.rice return self.beans return sclf.extra meat return self.guacamole return self.cheese return self.pico return self.corn 21 23 25 28 29 30 31 35 36 3sdef sst peahfexie.ne peal steak-, stchicken, pork if newmeat in lst: tofu,False) 40 41 42 43 self.meat-newmeat else: self.meat-False 45 46 def set_to go(self,to go):

Coding Problem 5.1.11 (Advanced) (External resource) (1.0 points possible) ? #0opy your Burrito class from the last exercise. Below, Console output will be displayed 2We ve given you three additional classes named “Meat” 3 “Rice” and Beans.”We’ve gone ahead and built getters 4 and setters in these classes to check if the incoming here 5 values are valid, so you’ll be able to remove those 6 from your original code. 7 class Burrito: def init (self, meat, to go, rice, beans, extra neat-False, guacamole-False, cheese-Faise, Ico-Faise, corn-False): self.set meat (meat) self.set to goto go selt.set rice (rice self.set beans (beans) self.set extra meat (extra meat) self.set guacamole(guacamole) self.set cheese (cheese) self.set_pico(pico) self.set corn (corn) 10 12 13 15 17 18 def get meat (self): def qet to go(self): def get_rice(self) def getbeans (self): def get_extra meat (self): def get guacamole(self) def get cheese (self): def get_pico(self): def get corn (self) 20 return self.meat return self.to gO return self.rice return self.beans return sclf.extra meat return self.guacamole return self.cheese return self.pico return self.corn 21 23 25 28 29 30 31 35 36 3sdef sst peahfexie.ne peal steak-, st”chicken, pork if newmeat in lst: “tofu”,False) 40 41 42 43 self.meat-newmeat else: self.meat-False 45 46 def set_to go(self,to go): Show transcribed image text

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Work Visual Studion Please Sample Run Different Please Explain Thank Objective Gain Q30243837 . . .

The coding should work in visual studion and please should besame as Sample Run and if different please explain Thank you

Objective

To gain experience with the operations involving binary searchtrees. This data structure as linked list uses dynamic memoryallocation to grow as the size of the data set grows. Unlike linkedlists, a binary search tree is very fast to insert, delete andsearch.

Project Description

When an author produce an index for his or her book, the firststep in this process is to decide which words should go into theindex; the second is to produce a list of the pages where each wordoccurs. Instead of trying to choose words out of our heads, wedecided to let the computer produce a list of all the unique wordsused in the manuscript and their frequency of occurrence. We couldthen go over the list and choose which words to put into theindex.

The main object in this problem is a “word” with associatedfrequency. The tentative definition of “word” here is a string ofalphanumeric characters between markers where markers are whitespace and all punctuation marks; anything non-alphanumeric stopsthe reading. If we skip all un-allowed characters before gettingthe string, we should have exactly what we want. Ignoring words offewer than three letters will remove from consideration such as”a”, “is”, “to”, “do”, and “by” that do not belong in an index.

In this project, you are asked to write a program to read anytext file and then list all the “words” in alphabetic order withtheir frequency together appeared in the article. The “word” isdefined above and has at least three letters.

Your result should be printed to an output file namedYourUserID.txt.

You need to create a Binary Search Tree (BST) to store all theword object by writing an insertion or increment function. Finally,a proper traversal print function of the BST should be able tooutput the required results.

The BST class in the text can not be used directly to solve thisproblem. It is also NOT a good idea to modify the BST class tosolve this problem. Instead, the following codes are recommended tostart your program.

//Data stored in the node type struct WordCount { string word; int count; }; //Node type: struct TreeNode { WordCount info; TreeNode * left; TreeNode * right; }; // Two function’s prototype // Increments the frequency count if the string is in the tree // or inserts the string if it is not there. void Insert(TreeNode*&, string); // Prints the words in the tree and their frequency counts. void PrintTree(TreeNode* , ofstream&); //Start your main function and the definitions of above two functions.

Sample Run

Please type the text file name: Lincoln.txt

Please give the output text file name: mus11.txt

You are done! You can open the file “mus11.txt” to check.

Press any key to continue

******************************************************************************************************************************

lincoln.txt

The Gettysburg Address

Gettysburg, Pennsylvania

November 19, 1863

Four score and seven years ago our fathers brought forth on thiscontinent, a new nation, conceived in

Liberty, and dedicated to the proposition that all men arecreated equal.

Now we are engaged in a great civil war, testing whether thatnation, or any nation so conceived and

so dedicated, can long endure. We are met on a greatbattle-field of that war. We have come to dedicate

a portion of that field, as a final resting place for those whohere gave their lives that that nation

might live. It is altogether fitting and proper that we shoulddo this.

But, in a larger sense, we can not dedicate — we can notconsecrate — we can not hallow — this ground.

The brave men, living and dead, who struggled here, haveconsecrated it, far above our poor power to add

or detract. The world will little note, nor long remember whatwe say here, but it can never forget what

they did here. It is for us the living, rather, to be dedicatedhere to the unfinished work which they

who fought here have thus far so nobly advanced. It is ratherfor us to be here dedicated to the great

task remaining before us — that from these honored dead we takeincreased devotion to that cause for

which they gave the last full measure of devotion — that wehere highly resolve that these dead shall not

have died in vain — that this nation, under God, shall have anew birth of freedom — and that government

of the people, by the people, for the people, shall not perishfrom the earth.

*****************************************************************************************************************************************

mus11.txt

1863 1
Address 1
But 1
Four 1
Gettysburg 2
God 1
Liberty 1
November 1
Now 1
Pennsylvania 1
The 3
above 1
add 1
advanced 1
ago 1
all 1
altogether 1
and 6
any 1
are 3
battle-field 1
before 1
birth 1
brave 1
brought 1
but 1
can 5
cause 1
civil 1
come 1
conceived 2
consecrate 1
consecrated 1
continent 1
created 1
dead 3
dedicate 2
dedicated 4
detract 1
devotion 2
did 1
died 1
earth 1
endure 1
engaged 1
equal 1
far 2
fathers 1
field 1
final 1
fitting 1
for 5
forget 1
forth 1
fought 1
freedom 1
from 2
full 1
gave 2
government 1
great 3
ground 1
hallow 1
have 5
here 8
highly 1
honored 1
increased 1
larger 1
last 1
little 1
live 1
lives 1
living 2
long 2
measure 1
men 2
met 1
might 1
nation 5
never 1
new 2
nobly 1
nor 1
not 5
note 1
our 2
people 3
perish 1
place 1
poor 1
portion 1
power 1
proper 1
proposition 1
rather 2
remaining 1
remember 1
resolve 1
resting 1
say 1
score 1
sense 1
seven 1
shall 3
should 1
struggled 1
take 1
task 1
testing 1
that 13
the 9
their 1
these 2
they 3
this 4
those 1
thus 1
under 1
unfinished 1
vain 1
war 2
what 2
whether 1
which 2
who 3
will 1
work 1
world 1
years 1

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Python Done Doesn T Work Need Help Part2 Cause Doesn T Work Test Case K 0 0 1 0 0 1 Q29613548 . . .

coding in python…

Below is what I have done but it doesn’t work…I need help with#part2 cause it doesn’t work for my test case ofk=[[(0,0),(1,0),(0,1)],[(2,5),(3,1),(2,2)]] which should returnjlist=[1,-3]

#part1

def jacobian(pts):

ptA = pts[0]

ptB = pts[1]

ptC = pts[2]

jac =(ptB[0]-ptA[0])*(ptC[1]-ptA[1])-(ptC[0]-ptA[0])*(ptB[1]-ptA[1])

return jac

#test case

#m=[(0,0),(1,0),(0,1)]

#jacobian(m)

#output: 1

#works as expected

#part2

def jacobianlist(k):

jlist = []

for i in range(len(k)):

jacobian(i)

jlist.append(jlist)

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coefficient Restitution Ball Number 0 1 Specifies Much Conserved Ball Hits Rigid Surface C Q26953982 . . .

The coefficient of restitution of a ball, a number between 0 and 1, specifies how much conserved when the ball hits a rigid surface. A coefficient of 0.9, for instance, means a bouncing ball will rise to 90% of its previous height after each bounce. The coefficient of restitution of a tennis ball, basketball, super ball and softball are 0.7, 0.75, 0.9. and 0.3 respectively. These values are stored in the array, coefOfRestitution. energy is double coefOfRestitution[4] = {0.7, 0.75, 0.09, 0.3); The requirements are to input the type of ball and an initial height, and report how many times a ball bounces when dropped from its initial height before it rises to a height of less than 10 centimetres. Also report the total distance travelled by the ball before this point. Data validation is performed for the input for type of ball to be between 0 and 3.

The coefficient of restitution of a ball, a number between 0 and 1, specifies how much conserved when the ball hits a rigid surface. A coefficient of 0.9, for instance, means a bouncing ball will rise to 90% of its previous height after each bounce. The coefficient of restitution of a tennis ball, basketball, super ball and softball are 0.7, 0.75, 0.9. and 0.3 respectively. These values are stored in the array, coefOfRestitution. energy is double coefOfRestitution[4] = {0.7, 0.75, 0.09, 0.3); The requirements are to input the type of ball and an initial height, and report how many times a ball bounces when dropped from its initial height before it rises to a height of less than 10 centimetres. Also report the total distance travelled by the ball before this point. Data validation is performed for the input for type of ball to be between 0 and 3. Show transcribed image text The coefficient of restitution of a ball, a number between 0 and 1, specifies how much conserved when the ball hits a rigid surface. A coefficient of 0.9, for instance, means a bouncing ball will rise to 90% of its previous height after each bounce. The coefficient of restitution of a tennis ball, basketball, super ball and softball are 0.7, 0.75, 0.9. and 0.3 respectively. These values are stored in the array, coefOfRestitution. energy is double coefOfRestitution[4] = {0.7, 0.75, 0.09, 0.3); The requirements are to input the type of ball and an initial height, and report how many times a ball bounces when dropped from its initial height before it rises to a height of less than 10 centimetres. Also report the total distance travelled by the ball before this point. Data validation is performed for the input for type of ball to be between 0 and 3.

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Coding Still Errors Couldn T Find Please Help Asap Thanks Q27077876 . . .

Name: Aljohani,Mohammed Date:82/25/2818 instructor:Shrestha description: the program calcaulate the slary and bonus for the employee include <iostream> include <cstdlib> include <ctime include <string> using nanespace std; nt main) double company pay-e; onst double executives- 1008.80; const double Manager- 5000.80; const double staff-1000.88; int experience; int bonus-0; string nane double salary; har choice; nt role; har option nt count exe- nt count man-e nt count_Sta-0; double random Cl 40 Type here to searci Character 42 (02A どmedia%2F811%2F811ac3d9-c0fe-4a4f-9ebc-59media%2F67f%2F67fcc48b-673d-4f56-a6b3-8amedia%2F1b8%2F1b80b264-513c-453f-9ea8-b4media%2F2a9%2F2a9bdf61-4c05-4cf2-9792-baI did the codingbut still have some errors I couldn’t find . Please help ASAP .ThanksName: Aljohani,Mohammed Date:82/25/2818 instructor:Shrestha description: the program calcaulate the slary and bonus for the employee include include include using nanespace std; nt main) double company pay-e; onst double executives- 1008.80; const double Manager- 5000.80; const double staff-1000.88; int experience; int bonus-0; string nane double salary; har choice; nt role; har option nt count exe- nt count man-e nt count_Sta-0; double random Cl 40 Type here to searci Character 42 (02A ど Show transcribed image text Name: Aljohani,Mohammed Date:82/25/2818 instructor:Shrestha description: the program calcaulate the slary and bonus for the employee include include include

Expert Answer


. . .

READ MORE
Coursehelp
QUESTION : No Comments

(Solved) : Codiocom Online Ori Mathway Announce Home Mail Dam Codio Codio Proj Cold Weat Get N Comman Q34451515 . . .

Cansomeone please help me with this code
을 codio.com Online Ori... Mathway Announce.. Home -Mail - dam... Codio Codio Proj.... cold weat.. # Get N from the command line import sys 4Nint (sys.argv[1]) Collapse) Challenges We provide you with a number N Your code goes here Create a list then, usinga loop, populate the list with N elements. Set each list element to the index multiplied by 10 9for i in range N): a , append(何0) print (a) 10 12 Beware: we might pass in a value 0, in which case you should return an empty list Check It을 codio.com Online Ori... Mathway Announce.. Home -Mail - dam... Codio Codio Proj.... cold weat.. # Get N from the command line import sys 4Nint (sys.argv[1]) Collapse) Challenges Program Failed for Input: 0 Expected Output: 0 Your Program Output: Your code goes here 9for i in range N): a , append(何0) print (a) 10 12 Your output was을 codio.com Online Ori… Mathway Announce.. Home -Mail – dam… Codio Codio Proj…. cold weat.. # Get N from the command line import sys 4Nint (sys.argv[1]) Collapse) Challenges We provide you with a number N Your code goes here Create a list then, usinga loop, populate the list with N elements. Set each list element to the index multiplied by 10 9for i in range N): a , append(何0) print (a) 10 12 Beware: we might pass in a value 0, in which case you should return an empty list Check It 을 codio.com Online Ori… Mathway Announce.. Home -Mail – dam… Codio Codio Proj…. cold weat.. # Get N from the command line import sys 4Nint (sys.argv[1]) Collapse) Challenges Program Failed for Input: 0 Expected Output: 0 Your Program Output: Your code goes here 9for i in range N): a , append(何0) print (a) 10 12 Your output was Show transcribed image text

Expert Answer


. . .

READ MORE