subject

Aveterinarian services many pets and their owners. as new pets are added to the population of pets being serviced, their information is entered into a flat text file. each month, the vet requests a listing of all pets sorted by their outstanding bill balance. you have to write a program to produce a report of animals and their owners sorted by their outstanding bill balances from the data in the flat text file. below is a description of the information on the text file:

the first entry is the number of animals on the file (numeric)

the fields below repeat for each animal:

o owner name (string) o birth year (numeric) o bill balance (numeric) o species (string)

o special feature (numeric or string)

the animals serviced by the veterinarian are of two types: mammals and non-mammals. for a mammal the special feature field on the flat file is the number of legs of the animal (numeric). for a non-mammal the special feature field is the blood type, warm-blooded or cold-blooded (string).

program requirements and grading:

from the information provided, write a solution that includes the following:

a suitable inheritance hierarchy which represents the pets serviced by the veterinarian. it is up to you how to design the inheritance hierarchy. i suggest an animal class and appropriate subclasses.

for all classes include the following:

o instancevariables

o constructors

o access or and mutator methods

o suitable tostring() methods

write a class _program7 which utilizes the following:

o an array of animal objects

o a method which reads the input file provided and stores the objects in the array

of animals.

o the input file provided, program7.txt, to test your program.

o a method which sorts the array of animals in ascending order by the balance.

o a method that formats and prints the output report. there should be one a nimal per line and at most 40 animals per page,

o the main metho d will call all the other methods which will:

â–ª read the text file and store the objects in the array

â–ª sort the objects

â–ª format and print the report

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:20
Sometimes writers elaborate on the truth when recalling past events so they can enhance their narrative essay with more interesting descriptions. do you feel that published writers should or should not embellish real life events just to make their stories more interesting?
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
question
Computers and Technology, 24.06.2019 21:30
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences.a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
Answers: 2
You know the right answer?
Aveterinarian services many pets and their owners. as new pets are added to the population of pets b...
Questions
question
Business, 10.12.2019 09:31
Questions on the website: 13722362