Question

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.

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_ProjectTimeLine".This application contains a class with name "Program.cs".Below are the details.

Program.cs :

//namespace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//application namespace
namespace Demo_ProjectTimeLine
{
class Program //Class
{
//Main method
static void Main(string[] args)
{
//getting system's current date and time
DateTime startDate = DateTime.Now;
//adding 4 years to the current date
DateTime endDate= startDate.AddYears(4);
//display job start date
Console.WriteLine("Job start Date and Time :"+ startDate);
//display job finish date prior to 1 day
Console.WriteLine("Job finish Date and Time :"+ endDate.AddDays(-1));
//finding number of days between start day and finish day
TimeSpan timeSpan = endDate - startDate;
//display number of days
Console.WriteLine("Number of days before deadline :"+timeSpan.Days);
//to hold the screen
Console.ReadLine();
}
}
}

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

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

Screen 1 :

CAWINDOWS1 system321cmd.exe Job start Date and Time20-03-2019 09:07:19 Job finish Date and Time 19-03-2023 09:07:19 Number of

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

Add a comment
Know the answer?
Add Answer to:
C#, help create a program based around the timeline of a building project. A building has to be b...
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
  • 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.

  • Can someone please help me with the following java assignment. So in this assignment you will...

    Can someone please help me with the following java assignment. So in this assignment you will begin with the starterProject I provide and then add to it.  I am also asking that before you begin you really look at the starterProject because this is the object-oriented basics. The starterProject is the exact same as the ClassClockExample.zip in Module 5.  I’ve also done this using a clock because it is something that you already know how it works.  Remember that OOD and OOP is...

  • with C++ You will create a program that uses a Critter class to move around a...

    with C++ You will create a program that uses a Critter class to move around a Grid, which is also a class. The Critter and the Grid classes will be in separate files. The Critter class will have a data member to count the number of moves made. It will also need data members to hold the current x and y coordinates. It will have a member function that randomly moves it one space in one of 4 directions. You...

  • *Using C++* You will create a program that uses a Critter class to move around a...

    *Using C++* You will create a program that uses a Critter class to move around a Grid, which is also a class. The Critter and the Grid classes will be in separate files. The Critter class will have a data member to count the number of moves made. It will also need data members to hold the current x and y coordinates. It will have a member function that randomly moves it one space in one of 4 directions. You...

  • need help with c++ project: For the project. Create a c++ program about bus booking and...

    need help with c++ project: For the project. Create a c++ program about bus booking and ticketing system that - This system also needs you to key in your username and password precisely and ask again to confirm your booking of the bus ticket, and output of the ticket fully displayed -Must include selections, looping and functions, and array. - minimum of 6 functions including main function Keywords that should not be in the source code: class, struct, fstream, ifstream,...

  • 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...

  • FOR RUBY: ----------------------------------- Create a program named Gifts. This program will describe the gifts for the...

    FOR RUBY: ----------------------------------- Create a program named Gifts. This program will describe the gifts for the 12 Days of Christmas. Each day describes one gift only. You cannot explicitly output the list of gifts, you need to get each day to display. For instance, for the 3rd day of Christmas, you display the gift for the 3rd day, then display the gift for the 2nd day, then the gift for the 1st day. Think about the logic for this.. in...

  • Project overview: Create a java graphics program that displays an order menu and bill from a...

    Project overview: Create a java graphics program that displays an order menu and bill from a Sandwich shop, or any other establishment you prefer. In this program the design is left up to the programmer however good object oriented design is required. Below are two images that should be used to assist in development of your program. Items are selected on the Order Calculator and the Message window that displays the Subtotal, Tax and Total is displayed when the Calculate...

  • Description: This project focuses on creating a Java class, Date.java, along with a client class, DateCleint.java,...

    Description: This project focuses on creating a Java class, Date.java, along with a client class, DateCleint.java, which will contain code that utilizes your Date.java class. You will submit both files (each with appropriate commenting). A very similar project is described in the Programming Projects section at the end of chapter 8, which you may find helpful as reference. Use (your own) Java class file Date.java, and a companion DateClient.java file to perform the following:  Ask user to enter Today’s...

  • Create a program using C++ for a store. It will be a ledger for daily transactions....

    Create a program using C++ for a store. It will be a ledger for daily transactions. It should be able to record the transactions on a date. The transactions will happen at a given time (hour, minute, second). Also, every transaction must have a unique ID that is a number that is randomly generated by the system. *Note that the transaction has an ID, NOT the items. There will be no more than 10 transactions on a date. Within every...

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
ADVERTISEMENT