Question

writing a c# program, in my program i have a job that is started with a...

writing a c# program, in my program i have a job that is started with a time from DateTime.now and has to be completed within 4 years. The deadline should not be stored but calculated from a DateTime property that returns the date 1 day prior to 4 years.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Console Application in C# is created using Visual Studio 2017 with name "Demo_DateTime".This application contains a program with name "Program.cs".Below are the details of this class.

Program.cs :

//namespace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//application namespace
namespace Demo_DateTime
{
class Program //Class
{
//Main method
static void Main(string[] args)
{
//getting current date and time
DateTime jobstartDate = DateTime.Now;
//adding 4 years to the current date
DateTime jobFinishDate= jobstartDate.AddYears(4);
//display job start date
Console.WriteLine("Job start Date and Time :"+ jobstartDate);
//display job finish date prior to 1 day
Console.WriteLine("Job finish Date and Time :"+ jobFinishDate.AddDays(-1));
//to hold the screen
Console.ReadLine();
}
}
}

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
writing a c# program, in my program i have a job that is started with a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C#, help create a program based around the timeline of a building project. A building has to be b...

    c#, help create a program based around the timeline of a building project. A building has to be built within 4 years of starting. The deadline should be calculated by a get only DateTime property that returns the date 1 day prior to the 4 year deadline. There should also be a timespan property that calculates the number of days before the deadline.

  • I need help writing this program in C. (not C++) Armor Games CrazyMonkeyGames Max Games Palomar...

    I need help writing this program in C. (not C++) Armor Games CrazyMonkeyGames Max Games Palomar College堯Wolfram|Alpha M Gmail EaXGen Studios How About a Date? Dinner and Dancing with your Computer The purpose of this assignment is to acquaint you with the capability of a computer program to systematically explore a set of possibilities and deter mine the validity of input to the program. HPal-CSC112Spring 2017/ Lab Solutions 12-How about a datelcheckDatelnC Debuglche... elcome to my Date Checker Project Enter...

  • C Programming Quesition (Structs in C): Write a C program that prompts the user for a...

    C Programming Quesition (Structs in C): Write a C program that prompts the user for a date (mm/dd/yyyy). The program should then take that date and use the formula on page 190 (see problem 2 in the textbook) to convert the date entered into a very large number representing a particular date. Here is the formula from Problem 2 in the textbook: A formula can be used to calculate the number of days between two dates. This is affected by...

  • I am writing a resignation letter to my nursing employer. I just got this job and...

    I am writing a resignation letter to my nursing employer. I just got this job and I have been training but I just feel its not a good fit for me. I took the job because I wanted to learn more about hands-on such as wound care, what to do during XYZ procedure, and medication names and what they are used for. Can someone help me make my letter flow better? Subject: Resignation – Firstname Lastname Dear Mr./Ms. Lastname, Please...

  • Is my writing for the email correct? I mean grammatically and academy. Dear Dr. Graham, Greetings!...

    Is my writing for the email correct? I mean grammatically and academy. Dear Dr. Graham, Greetings! I hope you are doing great! I am writing to you regarding my application which it is waiting some information from you. After you sent to me an email explaining that you accepted my application and told post-graduate recruitment officer (Martin Andrew ) about that. My friend Ali went to Mr. Martin to follow up with him about my application on Friday, 15th day...

  • ne of my current job is working as Wheeled Mechanic for the National Guard. I have...

    ne of my current job is working as Wheeled Mechanic for the National Guard. I have never worked as a mechanic in my civilian life but I do like working on fixing things around the house. As a result, I decided to work as a mechanic for the Army National Guard.    The job characteristic model has five different area. In reference to my job as wheeled mechanic and applying the skill variety, which is the skills and activities needed...

  • I am writing a Java program. My program would ask two questions: (1) 1+1=? (2) 2+1...

    I am writing a Java program. My program would ask two questions: (1) 1+1=? (2) 2+1 =? Show one question at a time on the console. The program allows users to input answers via a command-line (no GUI). Give users five seconds to answer each question. The next question would show ONLY when the user answers the question correctly OR when the time is up. Once users answer the question correctly within the given time, the next question needs to...

  • If I have to run another program from within my program, is system (anotherProgram) a good call to use? (Hint: env vari...

    If I have to run another program from within my program, is system (anotherProgram) a good call to use? (Hint: env variables; difference b/w exec or its variants and system call.) Google if you don't know what 'env variables' means things like current to, just like command line arguments @ run time. env variables are that the program has access path, name of shell etc, If I have to run another program from within my program, is system (anotherProgram) a...

  • Writing Unix Utilities in C (not C++ or C#) my-cat The program my-cat is a simple...

    Writing Unix Utilities in C (not C++ or C#) my-cat The program my-cat is a simple program. Generally, it reads a file as specified by the user and prints its contents. A typical usage is as follows, in which the user wants to see the contents of my-cat.c, and thus types: prompt> ./my-cat my-cat.c #include <stdio.h> ... As shown, my-cat reads the file my-cat.c and prints out its contents. The "./" before the my-cat above is a UNIX thing; it...

  • I need some help getting started with a writing assignment in physiology. I need to do...

    I need some help getting started with a writing assignment in physiology. I need to do the following: You will identify and explain in writing three separate examples from your own life that illustrate any three concepts covered in the class (for example, parenting styles -- you could describe which parenting style you were raised with I have chosen the social development in early childhood. The parenting styles I'm looking at are Authoritarian because I feel my parents fit in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT