Design a Java Animal class (assuming in Animal.java file) and a sub class of Animal named Cat (assuming in Cat.java file).
The Animal class has the following protected instance variables:
boolean vegetarian, String eatings, int numOfLegs and the following public instance methods:
constructor without parameters: initialize all of the instance variables to some default values
constructor with parameters: initialize all of the instance variables to the arguments
SetAnimal: assign arguments to all of the instance variables
Three “Get” methods which retrieve the respective values of the instance variables
toString: Returns the animal’s vegetarian, eatings and numOfLegs information as a string
The Cat class has the following private instance variable:
String color and the following public instance methods:
constructor without parameters: initialize all of the instance variables to some default values, including its super class - Animal’s instance variables
constructor with parameters: initialize all of the instance variables to the arguments, including its super class Animal’s instance variables
SetColor: assign its instance variable to the argument
GetColor: retrieve the color value
overrided toString: Returns the cat’s vegetarian, eatings, numOfLegs and color information as a string
Please write your complete Animal class, Cat class and a driver class as required below
a (35 pts) Write your complete Java code for the Animal class in Animal.java file
b (30 pts) Write your complete Java code for the Cat class in Cat.java file
b (35 pts) Write your test Java class and its main method which will create two Cats instances: e1 and e2, e1 is created with the default constructor, e2 is created with the explicit value constructor. Then update e1 to reset its vegetarian, eatings, numOfLegs and color. Output both cats’ detailed information. The above test Java class should be written in a Java file named testAnimal.java.
In: Computer Science
You connected your PC to a projector or printer, which is located 20 m away and transmitted a signal x(t) from the PC to the receiver through USB cable. State and briefly explain three impairments the signal x(t) may likely experience as it propagates through the transmission channel
In: Computer Science
#include<iostream>
using namespace std;
const int NUM = 20;
int main() {
// write code to Declare an integer array of size 20 and assign the array with 20 randomly generated integers in the range [1, 100].
// Shuffle the data in the array so that all numbers smaller than 50 are put before the numbers greater or equal to 50. Note you are not allowed to create any other arrays in the program.
// Write code to print out the shuffled array.
return 0;
}
Please Use C++ to solve
In: Computer Science
C++ Data Structures:
Use Huffman coding to encode text in given file
(Pride_and_Prejudice.txt).
TO_DO:
Define a struct for Huffman tree node. This struct contains links to left/right child nodes, a character, and its frequency.Define a function for file reading operation. This function should take in a filename (string type) as parameter and return a proper data structure object that contains characters and their frequencies that will be used to generate Huffman tree nodes.The construction of Huffman tree requires taking two nodes with smallest frequencies. Select a proper data structure to support this operation. Note this data structure object could be different to the object from step 2.
Design a function that takes in the root of Huffman coding tree, prints, and returns the encoding scheme in a data structure object.Design a function that takes in the encoding scheme and filename (string type), output encoded content (bit-string) to a file named pride.huff
Pride_and_Prejudice.txt:
Chapter 1
It is a truth universally acknowledged, that a single
man in possession of a good fortune, must be in want of a wife.
However little known the feelings or views of such a man may be on
his first entering a neighbourhood, this truth is so well fixed in
the minds of the surrounding families, that he is considered the
rightful property of some one or other of their daughters. “My dear
Mr. Bennet,” said his lady to him one day, “have you heard that
Netherfield Park is let at last?” Mr. Bennet replied that he had
not. “But it is,” returned she; “for Mrs. Long has just been here,
and she told me all about it.” Mr. Bennet made no answer. “Do you
not want to know who has taken it?” cried his wife impatiently.
“You want to tell me, and I have no objection to hearing it.” This
was invitation enough. “Why, my dear, you must know, Mrs. Long says
that Netherfield is taken by a young man of large fortune from the
north of England; that he came down on Monday in a chaise and four
to see the place, and was so much delighted with it, that he agreed
with Mr. Morris immediately; that he is to take possession before
Michaelmas, and some of his servants are to be in the house by the
end of next week.” “What is his name?” “Bingley.” “Is he married or
single?” “Oh! Single, my dear, to be sure! A single man of large
fortune; four or five thousand a year. What a fine thing for our
girls!” “How so? How can it affect them?” “My dear Mr. Bennet,”
replied his wife, “how can you be so tiresome! You must know that I
am thinking of his marrying one of them.” “Is that his design in
settling here?” “Design! Nonsense, how can you talk so! But it is
very likely that he may fall in love with one of them, and
therefore you must visit him as soon as he comes.” “I see no
occasion for that. You and the girls may go, or you may send them
by themselves, which perhaps will be still better, for as you are
as handsome as any of them, Mr. Bingley may like you the best of
the party.” “My dear, you flatter me. I certainly have had my share
of beauty, but I do not pretend to be anything extraordinary now.
When a woman has five grown-up daughters, she ought to give over
thinking of her own beauty.” “In such cases, a woman has not often
much beauty to think of.” “But, my dear, you must indeed go and see
Mr. Bingley when he comes into the neighbourhood.” “It is more than
I engage for, I assure you.” “But consider your daughters. Only
think what an establishment it would be for one of them. Sir
William and Lady Lucas are determined to go, merely on that
account, for in general, you know, they visit no newcomers. Indeed
you must go, for it will be impossible for us to visit him if you
do not.” “You are over-scrupulous, surely. I dare say Mr. Bingley
will be very glad to see you; and I will send a few lines by you to
assure him of my hearty consent to his marrying whichever he
chooses of the girls; though I must throw in a good word for my
little Lizzy.” “I desire you will do no such thing. Lizzy is not a
bit better than the others; and I am sure she is not half so
handsome as Jane, nor half so good-humoured as Lydia. But you are
always giving her the preference.” “They have none of them much to
recommend them,” replied he; “they are all silly and ignorant like
other girls; but Lizzy has something more of quickness than her
sisters.” “Mr. Bennet, how can you abuse your own children in such
a way? You take delight in vexing me. You have no compassion for my
poor nerves.” “You mistake me, my dear. I have a high respect for
your nerves. They are my old friends. I have heard you mention them
with consideration these last twenty years at least.” “Ah, you do
not know what I suffer.” “But I hope you will get over it, and live
to see many young men of four thousand a year come into the
neighbourhood.” “It will be no use to us, if twenty such should
come, since you will not visit them.” “Depend upon it, my dear,
that when there are twenty, I will visit them all.” Mr. Bennet was
so odd a mixture of quick parts, sarcastic humour, reserve, and
caprice, that the experience of three-and-twenty years had been
insufficient to make his wife understand his character. Her mind
was less difficult to develop. She was a woman of mean
understanding, little information, and uncertain temper. When she
was discontented, she fancied herself nervous. The business of her
life was to get her daughters married; its solace was visiting and
news. Chapter 2 Mr. Bennet was among the earliest of those who
waited on Mr. Bingley. He had always intended to visit him, though
to the last always assuring his wife that he should not go; and
till the evening after the visit was paid she had no knowledge of
it. It was then disclosed in the following manner. Observing his
second daughter employed in trimming a hat, he suddenly addressed
her with: “I hope Mr. Bingley will like it, Lizzy.” “We are not in
a way to know what Mr. Bingley likes,” said her mother resentfully,
“since we are not to visit.” “But you forget, mamma,” said
Elizabeth, “that we shall meet him at the assemblies, and that Mrs.
Long promised to introduce him.” “I do not believe Mrs. Long will
do any such thing. She has two nieces of her own. She is a selfish,
hypocritical woman, and I have no opinion of her.” “No more have
I,” said Mr. Bennet; “and I am glad to find that you do not depend
on her serving you.” Mrs. Bennet deigned not to make any reply,
but, unable to contain herself, began scolding one of her
daughters. “Don’t keep coughing so, Kitty, for Heaven’s sake! Have
a little compassion on my nerves. You tear them to pieces.” “Kitty
has no discretion in her coughs,” said her father; “she times them
ill.” “I do not cough for my own amusement,” replied Kitty
fretfully. “When is your next ball to be, Lizzy?” “To-morrow
fortnight.” “Aye, so it is,” cried her mother, “and Mrs. Long does
not come back till the day before; so it will be impossible for her
to introduce him, for she will not know him herself.” “Then, my
dear, you may have the advantage of your friend, and introduce Mr.
Bingley to her.” “Impossible, Mr. Bennet, impossible, when I am not
acquainted with him myself; how can you be so teasing?” “I honour
your circumspection. A fortnight’s acquaintance is certainly very
little. One cannot know what a man really is by the end of a
fortnight. But if we do not venture somebody else will; and after
all, Mrs. Long and her nieces must stand their chance; and,
therefore, as she will think it an act of kindness, if you decline
the office, I will take it on myself.” The girls stared at their
father. Mrs. Bennet said only, “Nonsense, nonsense!” “What can be
the meaning of that emphatic exclamation?” cried he. “Do you
consider the forms of introduction, and the stress that is laid on
them, as nonsense? I cannot quite agree with you there. What say
you, Mary? For you are a young lady of deep reflection, I know, and
read great books and make extracts.” Mary wished to say something
sensible, but knew not how. “While Mary is adjusting her ideas,” he
continued, “let us return to Mr. Bingley.” “I am sick of Mr.
Bingley,” cried his wife. “I am sorry to hear that; but why did not
you tell me that before? If I had known as much this morning I
certainly would not have called on him. It is very unlucky; but as
I have actually paid the visit, we cannot escape the acquaintance
now.” The astonishment of the ladies was just what he wished; that
of Mrs. Bennet perhaps surpassing the rest; though, when the first
tumult of joy was over, she began to declare that it was what she
had expected all the while. “How good it was in you, my dear Mr.
Bennet! But I knew I should persuade you at last. I was sure you
loved your girls too well to neglect such an acquaintance. Well,
how pleased I am! and it is such a good joke, too, that you should
have gone this morning and never said a word about it till now.”
“Now, Kitty, you may cough as much as you choose,” said Mr. Bennet;
and, as he spoke, he left the room, fatigued with the raptures of
his wife. “What an excellent father you have, girls!” said she,
when the door was shut. “I do not know how you will ever make him
amends for his kindness; or me, either, for that matter. At our
time of life it is not so pleasant, I can tell you, to be making
new acquaintances every day; but for your sakes, we would do
anything. Lydia, my love, though you are the youngest, I dare say
Mr. Bingley will dance with you at the next ball.” “Oh!” said Lydia
stoutly, “I am not afraid; for though I am the youngest, I’m the
tallest.” The rest of the evening was spent in conjecturing how
soon he would return Mr. Bennet’s visit, and determining when they
should ask him to dinner. Chapter 3 Not all that Mrs. Bennet,
however, with the assistance of her five daughters, could ask on
the subject, was sufficient to draw from her husband any
satisfactory description of Mr. Bingley. They attacked him in
various ways—with barefaced questions, ingenious suppositions, and
distant surmises; but he eluded the skill of them all, and they
were at last obliged to accept the second-hand intelligence of
their neighbour, Lady Lucas. Her report was highly favourable. Sir
William had been delighted with him. He was quite young,
wonderfully handsome, extremely agreeable, and, to crown the whole,
he meant to be at the next assembly with a large party. Nothing
could be more delightful! To be fond of dancing was a certain step
towards falling in love; and very lively hopes of Mr. Bingley’s
heart were entertained. “If I can but see one of my daughters
happily settled at Netherfield,” said Mrs. Bennet to her husband,
“and all the others equally well married, I shall have nothing to
wish for.” In a few days Mr. Bingley returned Mr. Bennet’s visit,
and sat about ten minutes with him in his library. He had
entertained hopes of being admitted to a sight of the young ladies,
of whose beauty he had heard much; but he saw only the father. The
ladies were somewhat more fortunate, for they had the advantage of
ascertaining from an upper window that he wore a blue coat, and
rode a black horse. An invitation to dinner was soon afterwards
dispatched; and already had Mrs. Bennet planned the courses that
were to do credit to her housekeeping, when an answer arrived which
deferred it all. Mr. Bingley was obliged to be in town the
following day, and, consequently, unable to accept the honour of
their invitation, etc. Mrs. Bennet was quite disconcerted. She
could not imagine what business he could have in town so soon after
his arrival in Hertfordshire; and she began to fear that he might
be always flying about from one place to another, and never settled
at Netherfield as he ought to be. Lady Lucas quieted her fears a
little by starting the idea of his being gone to London only to get
a large party for the ball; and a report soon followed that Mr.
Bingley was to bring twelve ladies and seven gentlemen with him to
the assembly. The girls grieved over such a number of ladies, but
were comforted the day before the ball by hearing, that instead of
twelve he brought only six with him from London—his five sisters
and a cousin. And when the party entered the assembly room it
consisted of only five altogether—Mr. Bingley, his two sisters, the
husband of the eldest, and another young man. Mr. Bingley was
good-looking and gentlemanlike; he had a pleasant countenance, and
easy, unaffected manners. His sisters were fine women, with an air
of decided fashion. His brother-in-law, Mr. Hurst, merely looked
the gentleman; but his friend Mr. Darcy soon drew the attention of
the room by his fine, tall person, handsome features, noble mien,
and the report which was in general circulation within five minutes
after his entrance, of his having ten thousand a year. The
gentlemen pronounced him to be a fine figure of a man, the ladies
declared he was much handsomer than Mr. Bingley, and he was looked
at with great admiration for about half the evening, till his
manners gave a disgust which turned the tide of his popularity; for
he was discovered to be proud; to be above his company, and above
being pleased; and not all his large estate in Derbyshire could
then save him from having a most forbidding, disagreeable
countenance, and being unworthy to be compared with his friend. Mr.
Bingley had soon made himself acquainted with all the principal
people in the room; he was lively and unreserved, danced every
dance, was angry that the ball closed so early, and talked of
giving one himself at Netherfield. Such amiable qualities must
speak for themselves. What a contrast between him and his friend!
Mr. Darcy danced only once with Mrs. Hurst and once with Miss
Bingley, declined being introduced to any other lady, and spent the
rest of the evening in walking about the room, speaking
occasionally to one of his own party. His character was decided. He
was the proudest, most disagreeable man in the world, and everybody
hoped that he would never come there again. Amongst the most
violent against him was Mrs. Bennet, whose dislike of his general
behaviour was sharpened into particular resentment by his having
slighted one of her daughters. Elizabeth Bennet had been obliged,
by the scarcity of gentlemen, to sit down for two dances; and
during part of that time, Mr. Darcy had been standing near enough
for her to hear a conversation between him and Mr. Bingley, who
came from the dance for a few minutes, to press his friend to join
it. “Come, Darcy,” said he, “I must have you dance. I hate to see
you standing about by yourself in this stupid manner. You had much
better dance.” “I certainly shall not. You know how I detest it,
unless I am particularly acquainted with my partner. At such an
assembly as this it would be insupportable. Your sisters are
engaged, and there is not another woman in the room whom it would
not be a punishment to me to stand up with.” “I would not be so
fastidious as you are,” cried Mr. Bingley, “for a kingdom! Upon my
honour, I never met with so many pleasant girls in my life as I
have this evening; and there are several of them you see uncommonly
pretty.” “You are dancing with the only handsome girl in the room,”
said Mr. Darcy, looking at the eldest Miss Bennet. “Oh! She is the
most beautiful creature I ever beheld! But there is one of her
sisters sitting down just behind you, who is very pretty, and I
dare say very agreeable. Do let me ask my partner to introduce
you.” “Which do you mean?” and turning round he looked for a moment
at Elizabeth, till catching her eye, he withdrew his own and coldly
said: “She is tolerable, but not handsome enough to tempt me; I am
in no humour at present to give consequence to young ladies who are
slighted by other men. You had better return to your partner and
enjoy her smiles, for you are wasting your time with me.” Mr.
Bingley followed his advice. Mr. Darcy walked off; and Elizabeth
remained with no very cordial feelings toward him. She told the
story, however, with great spirit among her friends; for she had a
lively, playful disposition, which delighted in anything
ridiculous. The evening altogether passed off pleasantly to the
whole family. Mrs. Bennet had seen her eldest daughter much admired
by the Netherfield party. Mr. Bingley had danced with her twice,
and she had been distinguished by his sisters. Jane was as much
gratified by this as her mother could be, though in a quieter way.
Elizabeth felt Jane’s pleasure. Mary had heard herself mentioned to
Miss Bingley as the most accomplished girl in the neighbourhood;
and Catherine and Lydia had been fortunate enough never to be
without partners, which was all that they had yet learnt to care
for at a ball. They returned, therefore, in good spirits to
Longbourn, the village where they lived, and of which they were the
principal inhabitants. They found Mr. Bennet still up. With a book
he was regardless of time; and on the present occasion he had a
good deal of curiosity as to the event of an evening which had
raised such splendid expectations. He had rather hoped that his
wife’s views on the stranger would be disappointed; but he soon
found out that he had a different story to hear. “Oh, my dear Mr.
Bennet,” as she entered the room, “we have had a most delightful
evening, a most excellent ball. I wish you had been there. Jane was
so admired, nothing could be like it. Everybody said how well she
looked; and Mr. Bingley thought her quite beautiful, and danced
with her twice! Only think of that, my dear; he actually danced
with her twice! and she was the only creature in the room that he
asked a second time. First of all, he asked Miss Lucas. I was so
vexed to see him stand up with her! But, however, he did not admire
her at all; indeed, nobody can, you know; and he seemed quite
struck with Jane as she was going down the dance. So he inquired
who she was, and got introduced, and asked her for the two next.
Then the two third he danced with Miss King, and the two fourth
with Maria Lucas, and the two fifth with Jane again, and the two
sixth with Lizzy, and the Boulanger—” “If he had had any compassion
for me,” cried her husband impatiently, “he would not have danced
half so much! For God’s sake, say no more of his partners. Oh that
he had sprained his ankle in the first dance!” “Oh! my dear, I am
quite delighted with him. He is so excessively handsome! And his
sisters are charming women. I never in my life saw anything more
elegant than their dresses. I dare say the lace upon Mrs. Hurst’s
gown—” Here she was interrupted again. Mr. Bennet protested against
any description of finery. She was therefore obliged to seek
another branch of the subject, and related, with much bitterness of
spirit and some exaggeration, the shocking rudeness of Mr. Darcy.
“But I can assure you,” she added, “that Lizzy does not lose much
by not suiting his fancy; for he is a most disagreeable, horrid
man, not at all worth pleasing. So high and so conceited that there
was no enduring him! He walked here, and he walked there, fancying
himself so very great! Not handsome enough to dance with! I wish
you had been there, my dear, to have given him one of your
set-downs. I quite detest the man.”
In: Computer Science
In C++
#include<iostream>
using namespace std;
const int NUM = 20;
int main() {
// write code to Declare an integer array of size 20 and assign the array with 20 randomly generated integers in the range [1, 100].
// Shuffle the data in the array so that all numbers smaller than 50 are put before the numbers greater or equal to 50. Note you are not allowed to create any other arrays in the program.
// Write code to print out the shuffled array.
return 0;
}
In: Computer Science
#include <iostream>
using namespace std;
void SortArrays (int a[], int b[], int c[], int size);
void printArray(int m[], int length);
const int NUM = 5;
int main()
{
int arrA[NUM] = {-2, 31, 43, 55, 67};
int arrB[NUM] = {-4, 9, 11, 17, 19};
int result[2*NUM];
SortArrays(arrA, arrB, result, NUM);
printArray(result, 2*NUM);
return 0;
}
void SortArrays (int a[], int b[], int c[], int size)
{
}
void printArray(int m[], int length)
{
for(int i = 0; i < length; i++)
cout<< m[i]<<" ";
cout<<endl;
}
Please Use C++
In: Computer Science
The security for application software is enhanced and optimized through a procedure called threat modeling. In major applications, such as those used by manufacturing, banking, or distribution companies, that do scheduling, resource management, inventory management, accounting, and more, security is a crucial element of its operations. Research threat modeling and briefly describe a procedure you would recommend to provide robust security for a major application in this type of environment
In: Computer Science
´Software Engineer Christopher is hired by software company, ABC Software, and involved in the design of specialized software for Gladstone City Council (GCC) in connection with the operations of facilities that impact on public health and safety, such as those that control air and water quality. Testing the software system is part of the design process. Christopher conducts extensive testing and finds that the software is safe to use under existing standards. But Christopher is aware that new draft standards are about to be released by the national standard setting organization, standards that the newly designed software may not meet. Christopher suggests that ABC Software and GCC perform additional testing on the software to see if it meets these new safety standards. Such testing would determine whether the software is suitable for release as it currently exists or whether further development is required. But GCC is eager to proceed and ABC Software is eager to satisfy its client and protect its finances and existing jobs. Doing the additional testing would be extremely costly and delay the project at least six months. This would put ABC Software at a competitive disadvantage and cost it a lot of money, putting the goals of protecting its finances at risk. However, ABC Software wants to be sure that the software is safe to use. ABC Software has requested Christopher's recommendation concerning the need for additional software testing. (adapted from Online Ethics Centre for Engineering and Science. Software Design Testing. Retrieved 24/9/2014 from http://www.onlineethics.org/Resources/Cases/ec96-4.aspx)
´a) State the ethical dilemma that confronts Christopher. b) Use bullet points to list the relevant facts as given in the scenario. c) What are the potential consequences and to whom, if the software is not tested further and the new standards are not met? d) What are the consequences and to whom, if the extra testing is done? e) What conflicting duties does Christopher have in this scenario? f) What rights do the general public, Gladstone City Council and ABC Software have in this scenario g) What virtues should Christopher exhibit in this scenario are observe in this scenario? i) Recommend the course of action that Christopher should take giving reasons based on some or all of your previous 6 answers (parts c to h)
In: Computer Science
#include <iostream>
using namespace std;
void SortArrays (int a[], int b[], int c[], int size);
void printArray(int m[], int length);
const int NUM = 5;
int main()
{
int arrA[NUM] = {-2, 31, 43, 55, 67};
int arrB[NUM] = {-4, 9, 11, 17, 19};
int result[2*NUM];
SortArrays(arrA, arrB, result, NUM);
printArray(result, 2*NUM);
return 0;
}
void SortArrays (int a[], int b[], int c[], int size)
{
}
void printArray(int m[], int length)
{
for(int i = 0; i < length; i++)
cout<< m[i]<<" ";
cout<<endl;
In: Computer Science
in C++
Given two integer arrays sorted in the ascending order, code the function SortArrays to merge them into one array in the descending order. You need to make sure if the values in the arrays are changed, it will still work. (25 points)
#include <iostream>
using namespace std;
void SortArrays (int a[], int b[], int c[], int size);
void printArray(int m[], int length);
const int NUM = 5;
int main()
{
int arrA[NUM] = {-2, 31, 43, 55, 67};
int arrB[NUM] = {-4, 9, 11, 17, 19};
int result[2*NUM];
SortArrays(arrA, arrB, result, NUM);
printArray(result, 2*NUM);
return 0;
}
void SortArrays (int a[], int b[], int c[], int size)
{
}
void printArray(int m[], int length)
{
for(int i = 0; i < length; i++)
cout<< m[i]<<" ";
cout<<endl;
}
In: Computer Science
Consider the following case study: Clean Planet is a private business based in Victoria specialising in commercial cleaning supplies and business support products for organisational clients. Only a few computerized operations are in the business. In an effort to become more efficient and profitable, the vice president, Julia Thompson, has hired a systems analyst, Robert Hanover. Julia and Robert have made progress in the development of a strategic plan for Clean Planet. Robert is anxious to define the requirements for the new system. He has gathered more information and has created the following organization chart for Clean Planet. Robert: Julia, it’s time to start moving on the system investigation. The mission statement is finalized and strategic planning is well underway. I can see that the directors are beginning to think about how their departments can benefit from better information management. Julia: You’re right! Andrew McClean found out that we lost a big order the other day because the customer was able to get the estimate much more quickly from another company because of their online presence. He’s wondering just how many sales we are losing because of timeliness issues. I had Anna’s group gather numbers for the directors about how many times our profit margin has been reduced because of human error somewhere along the order process. We are profitable but could be more so by reducing error and becoming more competitive with timely information to our potential customers. Robert: Andrew’s area of sales is a logical place to start the investigation. I need to interview sales and customer service representatives to get an idea of the requirements for the new information system. What kind of information will we include? What do we want to get out? What processes need to be managed? What are our business needs? Charles Edwards President Julia Edwards Vice President Andrew McClean Director of Sales Anna McNally Director of Finance Martha Seymour Director of Operations Dennis Martin Shipping/Receiving Manager George Thompson Warehouse Manager Sales Rep (6) Accounting/Billing Clerk (2) Customer Service Rep (3) Julia: This will take some time, and a lot of information needs to be gathered. You should make sure you spend some time with the accounting clerks too because they fill in for customer service representatives. Robert: I’m ready to get started! Answer the following questions: a. Develop a fact-finding plan including interviews, documentation review, observation, questionnaires, sampling, and research. b. Review the organizational model above and list the individuals you would like to interview. Prepare a list of objectives for each of the interviews you will conduct. c. Prepare a list of specific questions for each individual you will interview.
In: Computer Science
You will implement and test the sequence class using an array to store the sequence's items in C++. sequence1.h: The header file for the sequence class. Actually, you don't have to write much of this file. Start with the sequence1.h header file provided and add your name and other information at the top. Also, decide on appropriate private member variables, and declare these in the sequence class definition at the bottom of the header file. If some of your member functions are implemented as inline functions, then you may put those implementations in this file too. 2. sequence1.cxx: The implementation file for this first sequence class. You will write all of this file, which will have the implementations of all the sequence's member functions. // FILE: sequence1.h // CLASS PROVIDED: sequence (part of the namespace main_savitch_3) // There is no implementation file provided for this class since it is // an exercise from Section 3.2 of "Data Structures and Other Objects Using C++" // // TYPEDEFS and MEMBER CONSTANTS for the sequence class: // typedef ____ value_type // sequence::value_type is the data type of the items in the sequence. It // may be any of the C++ built-in types (int, char, etc.), or a class with a // default constructor, an assignment operator, and a copy constructor. // // typedef ____ size_type // sequence::size_type is the data type of any variable that keeps track of // how many items are in a sequence. // // static const size_type CAPACITY = _____ // sequence::CAPACITY is the maximum number of items that a sequence can hold. // // CONSTRUCTOR for the sequence class: // sequence( ) // Postcondition: The sequence has been initialized as an empty sequence. // // MODIFICATION MEMBER FUNCTIONS for the sequence class: // void start( ) // Postcondition: The first item on the sequence becomes the current item // (but if the sequence is empty, then there is no current item). // // void advance( ) // Precondition: is_item returns true. // Postcondition: If the current item was already the last item in the // sequence, then there is no longer any current item. Otherwise, the new // current item is the item immediately after the original current item. // // void insert(const value_type& entry) // Precondition: size( ) < CAPACITY. // Postcondition: A new copy of entry has been inserted in the sequence // before the current item. If there was no current item, then the new entry // has been inserted at the front of the sequence. In either case, the newly // inserted item is now the current item of the sequence. // // void attach(const value_type& entry) // Precondition: size( ) < CAPACITY. // Postcondition: A new copy of entry has been inserted in the sequence after // the current item. If there was no current item, then the new entry has // been attached to the end of the sequence. In either case, the newly // inserted item is now the current item of the sequence. // // void remove_current( ) // Precondition: is_item returns true. // Postcondition: The current item has been removed from the sequence, and the // item after this (if there is one) is now the new current item. // // CONSTANT MEMBER FUNCTIONS for the sequence class: // size_type size( ) const // Postcondition: The return value is the number of items in the sequence. // // bool is_item( ) const // Postcondition: A true return value indicates that there is a valid // "current" item that may be retrieved by activating the current // member function (listed below). A false return value indicates that // there is no valid current item. // // value_type current( ) const // Precondition: is_item( ) returns true. // Postcondition: The item returned is the current item in the sequence. // // VALUE SEMANTICS for the sequence class: // Assignments and the copy constructor may be used with sequence objects. #ifndef MAIN_SAVITCH_SEQUENCE_H #define MAIN_SAVITCH_SEQUENCE_H #include // Provides size_t namespace main_savitch_3 { class sequence { public: // TYPEDEFS and MEMBER CONSTANTS typedef double value_type; typedef std::size_t size_type; static const size_type CAPACITY = 30; // CONSTRUCTOR sequence( ); // MODIFICATION MEMBER FUNCTIONS void start( ); void advance( ); void insert(const value_type& entry); void attach(const value_type& entry); void remove_current( ); // CONSTANT MEMBER FUNCTIONS size_type size( ) const; bool is_item( ) const; value_type current( ) const; private: value_type data[CAPACITY]; size_type used; size_type current_index; }; } #endif
In: Computer Science
Additional Requirements
1.The name of your source code fileshould be ProbEst.py All your code should be within a single file.
2.You cannot import any package except for pandas.You need to use the pandas DataFrame object for storing data
Requirements Y ou are to create a program in Python that performs the following: 1. Asks the user for the number of cars (i.e. data instances) . 2. F or each car , ask s the user to enter the following fields: make, model , type (coupe, sedan, SUV), rating (A, B, C, D, or F) . Save the feature values for each car in a DataFrame object. 3. Display s the resulting DataFrame 4. Compute s the probability of each rating and output s to the screen. 5. For each type , compute s the conditional probability of that type, given each of the ratings: 6. Display s the conditional probabilities to the screen.
Output
70-511, [semester] [year]
NAME: [put your name here]
PROGRAMMING ASSIGNMENT #4
Enter the number of car instances:6
Enter the make,model,type,rating:ford,mustang,coupe,A
Enter the make,model,type,rating:chevy,camaro,coupe,B
Enter the make,model,type,rating:ford,fiesta,sedan,C
Enter the make,model,type,rating:ford,focus,sedan,A
Enter the make,model,type,rating:ford,taurus,sedan,B
Enter the make,model,type,rating:toyota,camry,sedan,B
make model type rating
0 ford mustang coupe A
1 chevy camaro coupe B
2 ford fiesta sedan C
3 ford focus sedan A
4 ford taurus sedan B
5 toyota camry sedan B
Prob(rating=A) = 0.333333
Prob(rating=B) = 0.500000
Prob(rating=C) = 0.166667
Prob(type=coupe|rating=A) = 0.500000
Prob(type=sedan|rating=A) = 0.500000
Prob(type=coupe|rating=B) = 0.333333
Prob(type=sedan|rating=B) = 0.666667
Prob(type=coupe|rating=C) = 0.000000
Prob(type=sedan|rating=C) = 1.000000
In: Computer Science
Describe the role of cyber forensics examiners and unique factors to keep in mind when collecting evidence at a scene.
In: Computer Science
Use what you learned in Chapter 19 to display the following date and time using php:
Today is Tuesday October 6th.
The current time is 14:07:29 PM PDT.
Your display should appear exactly has displayed on separate lines. The date should be displayed using one function from the chapter and the time another.
In: Computer Science