C# Answers

Questions answered by Experts: 1 362

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Write a program in which you declare a class HotelRoom. The class has the fol- lowing private instance variables: the room number (a string), the room capacity (an integer representing the maximum number of people the room can accom- modate), the occupancy status (an integer, 0 if the room is not occupied, other- wise the number of occupants in the room), and the daily rate (a double). Include a three-argument constructor that sets the room number to its first argument, the room capacity to the second argument, the room rate to the third argument, and that sets the room occupancy status to 0. Compile and test the program. Note: We will continue this exercise in the next section.
Number Analysis Program 


Write a program that reads data from file numbers.txt and process it. The file contains a series of numbers, each written on a separate line. The program should read the contents of the file into an array and then display the lowest, highest, total, and average of the numbers in the array. The program should have the following functions: 


readNumbers. This function reads numbers from file and stores them in the array.

getLowest. This function finds the lowest value in the array and returns that value.

getHighest. This function finds the highest value in the array and returns that value.

getSum. This function calculates and returns the sum of the values in the array.

getAverage. This function calculates and returns the average of the values in the array.
Write a program that uses an array of string objects to hold the five student names, an array of five characters to hold the five students’ letter grades, and five arrays of four doubles to hold each student’s set of test scores.

The program should allow the user to enter each student’s name and his or her four test scores. It should then calculate and display each student’s average test score and a letter grade based on the average.

Input Validation: Do not accept test scores less than 0 or greater than 100.
Student e-mail IDs at Pace University consist of the first and last initials of the student, followed by five digits, followed by either the letter n or the letter p.
Write a program that asks the user to enter a Pace e-mail ID. The program should then validate the form of the ID as just described. If the ID is invalid, the pro- gram should tell the user which part (or parts) of the ID is invalid. If the ID is valid, the program should display an appropriate message.
Your city’s Parking Violation Bu-reau wants you to write a program to compute fines for parking violations. There are four types of violation: type A carries a fine of $10, type B carries a fine of $20, type C carries a fine of $30, and type D carries a fine of $50. The program should ask for the name of offender, the number of type A violations, the number of type B violations, and so on. Store the offender’s name in a string object. The program should display the offender’s name and the total fine for the person.
By using the concept of structure, write a program that use structure tag name struct Person of five (5) persons that consist variable name, age, gender and address. Each person must have different addresses whereby another structure called struct Address need to be derived from each person. struct Address must consist of variable roadname, state, and zipcode. Any member of a structure, use the member access operator (.) to output the data of these five (5) persons.
To reveal your code’s functionality, your output should have similar layout as below :
NAME: LUKE SKYWALKER AGE: 29
GENDER: M
ADDRESS
ROADNAME: 107, NEBULA STAR,GALAXY FAR FAR AWAY
ZIPCODE: 41799
STATE: NEPTUNE
A sweatshirt manufacturer wants to take inventory of the college logo sweat- shirts that it has in stock. The company makes sweatshirts for seven colleges. Refer to the colleges by number, 1–7. Sweatshirts come in four sizes: small, medi- um, large, and x-large. An employee gathers the inventory information by hand. Write a program that prompts the employee to enter the number of sweatshirts in stock for each of the seven colleges in each of the four sizes. Store the inventory information in a two-dimensional array. After inputting the inventory data, the program should display an inventory report in the following format.
Write a program that asks the user to enter up to 20 integers.Store the integers in an array of longs. Then, the program should ask the user to enter an integer. The program should use the function Find_It()to locate the integer in the array. The third argument in Find_It() is the address of the found integer. The function should return 1 if the integer is found and 0 otherwise. If the integer is found, the program should replace the integer by its negative and display the elements in the array. If the integer is not found, display an appropriate message.
A sweatshirt manufacturer wants to take inventory of the college logo sweat- shirts that it has in stock. The company makes sweatshirts for seven colleges. Refer to the colleges by number, 1–7. Sweatshirts come in four sizes: small, medi- um, large, and x-large. An employee gathers the inventory information by hand. Write a program that prompts the employee to enter the number of sweatshirts in stock for each of the seven colleges in each of the four sizes. Store the inventory information in a two-dimensional array. After inputting the inventory data, the program should display an inventory report in the following format.
Inventory Report College
1 2 3 4 5 6 7 Total
Size
Small Medium
Large
XLarge
College Total Total Quantity On Hand
At the end of each row should be the total inventory for that size. At the bottom of each column should be total inventory of each college. The Total Quantity On Hand should be the total inventory of all sweatshirts.
i want to ask that how can i apply time limit in snake game.Please send the easiest method.
LATEST TUTORIALS
APPROVED BY CLIENTS