Questions: 1 835

Answers by our Experts: 1 539

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 & Filtering

For this solution, you are required to make use of a switch statement. Write a program that reads in a month of the year as a number (eg 1 for January, 4 for April) and then displays the number of days in that month. Once you have planned the basic solution, take note that leap years has an impact. However, the only impact it has is when a user has specified the value for February – you should then ask the user for the year of interest. You do not need to write specialised functionality to determine whether a year was a leap year, as C# has a build-in method which can be used. In short summary: The DateTime.IsLeapYear() method in C# can be used to check whether the specified year is a leap year.


The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 to 5.


Write a program that outputs a hurricane’s category based on the user’s input of the wind speed.


You may assume that wind speeds will be provided as integer values.


The categories are as follows:



252 km/h or higher-- 5


209 – 251 km/h --4


178 – 208 km/h --3


154 – 177 km/h-- 2


119 – 153 km/h --1



Any storm with winds of less than 119 km/h is not a hurricane


Write a program that asks a user for an IQ score. If the score is a number less than 0 or greater


than 200, issue an error message. Otherwise issue a message according to the following values:



Under 100 Below average


100 Average


Above 100 Above average

Write a function solution that given an integer n and an integer k, returns the maximum possible three-digit value that can be obtained by performing at most K increases by 1 of any digit in N


# Introduction

You have been handed this project containing a logger which is supposed to write log statements asynchronously to a sink. However it does not seem to work asynchronously... The project is meant as an in-house replacement for `log4net` and `Serilog`. The initial contributor is no longer with us, so you now get the task.

Below is a prioritized backlog.


# Backlog


1. Refactor Logger to be as fast as possible, so the caller can get on with its work and not wait for the log statement to be written. This can be verified by running the test `IsLoggingFast`

*However due to the fact that the logger is currently used in other systems, the current Write method can not have its signature changed

2. Make sure the loggernever crashes the calling application due to errors

3. Make sure the code is covered by relevant unit tests

4. Enrich log statements with timestamp and log level (debug, Information, Warning, Error)

5. Implement a file sink

6. Refactor AsyncLogger to be able to use multiple sinks


 Create a class called Employee that includes three pieces of information as data members, a name (type string), ID (type integer) and a monthly salary (type integer). Employee class should have a constructor that initializes the three data members. And employee class should have a destructor which shows message when object of the class is destroyed from the memory. Provide a “setData” and a “getData” function for each data member. If the monthly salary is not positive, set it to -1.

Write a test program that demonstrates class Employee’s functionalities. Create two Employee objects and display each object’s yearly salary after deducting 4% tax.

Note...Its C# Question


(a) Ask the user to enter 5 integer values between 1 and 50. Create a simple bar graph using the character of your choice.

Hint: You may want to try to use a loop within a loop (a nested loop). Don't forget to indent properly! (2A)

For example: If the user were to enter 3, 1, 6, 2, 5, the output might look like:

***

*

******

**

*****

Extension:

(d) [challenge] Make the bar graph horizontal (2T)


Write a program that reads in the description and amount for 3 items purchased by a customer (you can assume that the customer is buying 1 of each item). The program must calculate the total, then determine the discount amount (at 5% discount) and the amount after discount. Furthermore, the store provides a “loyalty point” for each R5 spend (before discount). The final slip must have the following structure (including the blank lines as shown). The 3 item amounts have no currency sign, is aligned on the right and displays 2 decimal places. Below the list of items, the total, discount and final amounts must show the currency sign.


To create this specific output, the memo uses an item column width of 17 characters and an amount column width of 7 characters for the list of the 3 items. You do not need to use the same values, but you can use it as guidance. You can also use spaces and the \t escape sequence or a combination of different plans for alignment.


Write a program in C# to get the largest element of an array using a function.


Test Data:


Input the number of elements to be stored in the array: 5


Input 5 elements in the array:


element - 0: 1


element - 1: 2


element - 2: 3


element - 3: 4


element - 4: 5


Expected Output:


The largest element in the array is: 5

using microsoft visual studio

With a Malaysian NRIC, you can detect a few things, namely:

Birthdate

State of birth

Gender

Birthdate is given in yymmdd format (the first six digits).

State of birth: the following two digits.

The following three digits are just some running numbers without much significance.

The last one digit tells you the IC holder is a male or female based on the number being

odd or even number – odd means “male”, “even” or zero means “female”.

In a form, allow the input that will accept:

The name of the person

The IC number if that person is Malaysian or a passport number if that person is

not a Malaysian

Whether that person is married, divorced or single.

The output for each input will read:

Mr. Faudzi Ahmad was born outside of Malaysia on 25 November 1965 and he is

currently 56 years old.

Ms. Roziah Kamaruddin was born in Johor on 1 January 2000 and she is currently 22

years old.





LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS