Question

Create a console application project and solution called “ConsoleWorkWithData.” using C# Create the following variables with...

Create a console application project and solution called “ConsoleWorkWithData.” using C#

Create the following variables with data type:

a. FirstName: string data type

b. LastName: string data type

c. Student ID: int data type

d. BirthDate: data time data type

e. Grade: decimal data type

Write all values in these variables to the screen in this format:

a. ---------------------------------------------------------

b. My name is Rieser Angie

c. I’m a new student, and this is my first program

d. **************************************

e. My student id is: ARIESE2654

f. My birthdate is: 05-10-1998

g. My Grade is: 90.94

h. ______________________________________

0 0
Add a comment Improve this question Transcribed image text
Answer #1

using System.IO;
using System;

class Program
{
static void Main()
{
Console.Write("Enter First Name: ");
string firstName = Console.ReadLine();
Console.Write("Enter Last Name: ");
string lastName = Console.ReadLine();
Console.Write("Enter Student ID: ");
int studentId= Convert.ToInt32(Console.ReadLine());
Console.Write("Enter Birth Date: ");
DateTime birthDate = DateTime.Parse(Console.ReadLine());
Console.Write("Enter Grade: ");
decimal grade = decimal.Parse(Console.ReadLine());
Console.WriteLine();
Console.WriteLine("---------------------------------------------------------");
Console.WriteLine("My name is "+firstName+" "+lastName);
Console.WriteLine("I’m a new student, and this is my first program");
Console.WriteLine("**************************************");
Console.WriteLine("My student id is: ARIESE"+studentId);
Console.WriteLine("My birthdate is: "+birthDate.ToString("dd-MM-yyyy"));
Console.WriteLine("My Grade is: "+grade);
Console.WriteLine("---------------------------------------------------------");
}
}

Output:

$mcs *.cs -out:main.exe
$mono main.exe
Enter First Name: Enter Last Name: Enter Student ID: Enter Birth Date: Enter Grade: 
---------------------------------------------------------
My name is Rieser Angie
I’m a new student, and this is my first program
**************************************
My student id is: ARIESE2654
My birthdate is: 10-05-1998
My Grade is: 90.94
---------------------------------------------------------
Add a comment
Know the answer?
Add Answer to:
Create a console application project and solution called “ConsoleWorkWithData.” using C# Create the following variables with...
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
  • Here is the code from the previous three steps: #include <iostream> using namespace std; class Student...

    Here is the code from the previous three steps: #include <iostream> using namespace std; class Student { private: //class variables int ID; string firstName,lastName; public: Student(int ID,string firstName,string lastName) //constructor { this->ID=ID; this->firstName=firstName; this->lastName=lastName; } int getID() //getter method { return ID; } virtual string getType() = 0; //pure virtual function virtual void printInfo() //virtual function to print basic details of a student { cout << "Student type: " << getType() << endl; cout << "Student ID: " << ID...

  • Create a C# console application that performs the following: 1) Build a method which reads 3...

    Create a C# console application that performs the following: 1) Build a method which reads 3 integers from the console and returns them as an int array (type a number, then hit enter, 3 times). This needs to be its own method. 2) Call this method twice to store 2 local int array variables. 3) Once both arrays are built, write another method which accepts the two arrays and compares the contents to see if they match. If the method...

  • Create a C# console application that performs the following: 1) Build a method which reads 3...

    Create a C# console application that performs the following: 1) Build a method which reads 3 integers from the console and returns them as an int array (type a number, then hit enter, 3 times). This needs to be its own method. 2) Call this method twice to store 2 local int array variables. 3) Once both arrays are built, write another method which accepts the two arrays and compares the contents to see if they match. If the method...

  • In c programming . Part A: Writing into a Sequential File Write a C program called...

    In c programming . Part A: Writing into a Sequential File Write a C program called "Lab5A.c" to prompt the user and store 5 student records into a file called "stdInfo.txt". This "stdInfo.txt" file will also be used in the second part of this laboratory exercise The format of the file would look like this sample (excluding the first line) ID FIRSTNAME LASTNAME GPA YEAR 10 jack drell 64.5 2018 20 mina alam 92.3 2016 40 abed alie 54.0 2017...

  • answer in c# console application. File l/O Create a Person class (firstName, lastName, phoneNumber, gender (Use...

    answer in c# console application. File l/O Create a Person class (firstName, lastName, phoneNumber, gender (Use radioButtons for gender in the GUI) ) Create a List<Person> Create a GUI that will collect the Person information from the user and have 3 buttons: Add, Display, Read. Add button Add the just created person to List<Person>, and append to a text file Display button > print out all persons currently in the List<Person> in a label in a visually attractive way Read...

  • C++ program Create a Student class that contains three private data members of stududentID (int), lastName...

    C++ program Create a Student class that contains three private data members of stududentID (int), lastName (string), firstName(string) and a static data member studentCount(int). Create a constructor that will take three parameters of studentID, lastName and firstName, and assign them to the private data member. Then, increase the studentCount in the constructor. Create a static function getStudentCount() that returns the value of studentCount. studentCount is used to track the number of student object has been instantiated. Initialize it to 0...

  • To conclude the project, use the UML diagram you created last week and create an application...

    To conclude the project, use the UML diagram you created last week and create an application in Visual Studio named School. Once you have written the code, be sure and test it to ensure it works before submitting it. Below is the UML diagram for the basic class we created last week for your reference, but for this project be sure you use the one that you created last week. Good luck and be sure to get started early in...

  • Introduction In this lab, you will be working with three classes: Person, Student, and Roster. Person...

    Introduction In this lab, you will be working with three classes: Person, Student, and Roster. Person and Student represent individuals with a first and last name as String class variables, and Student has an additional int class variable that represents a ID number. The Roster class represents a group of people that are objects of either the Person or Student class. It contains an ArrayList. The Person class has been completed for you with class variables, a constructor, and a...

  • Java Project In Brief... For this Java project, you will create a Java program for a...

    Java Project In Brief... For this Java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms. For each classroom, the report will contain: I need a code that works, runs and the packages are working as well The room number of the classroom. The teacher and the subject assigned to the classroom. A list of students assigned to the classroom including their student id and final grade....

  • using basic c++ please!!! 6. (21%) Consider the following definitions class Student { class Section public:...

    using basic c++ please!!! 6. (21%) Consider the following definitions class Student { class Section public: string getFirst (); string getLast (); intgetGrade () void setFirst (string s); void setLast (string s); void setGrade(int g); numStudents (); in Student getNthStudent (int n); string getCourse (); string getInstructor (); private: private: string firstName; string lastName; int Student students [SIZE]; string course; string instructor; grade ; Write a function, honorRoll that returns a dynamic array containing only those students in section sec...

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