Westonci.ca is the ultimate Q&A platform, offering detailed and reliable answers from a knowledgeable community. Join our Q&A platform and connect with professionals ready to provide precise answers to your questions in various areas. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.

Personalize your code by adding statements that print your name, course, and assignment title to the console.
Analyze the options for the data types and their implication on the accuracy of the performed operations within the project. Explain, justify, and document the selections you made. Declare and, where appropriate, initialize the constants and variables. Display the questions and answers on the console. Read user input pertaining to the question from the console. Display the user input on the console.
Refer to the High-Quality Programming Code, DOCXPreview the document, file as a reference and guideline when writing your code.
For this assignment, you will submit the .cs file that contains all of the code from this assignment. Include your name in the top of the script using the following format. CH2DoeJohn.cs
Save and submit your assignment in a file using this naming convention. Do not add punctuation or special characters. CH2DoeJohn.cs

Sagot :

Solution :

class MainClass {

public static void Main(string[] args){

// Declaring variables here

// Change the name , course name and assignment name

String name = "Your name here"; //Stores name of the student

String courseName = "Course Name here"; //Stores course name

String assignmentName = "Assignment name here";//Stores assignment name

int answer; //Stores answer

// Dispaying the name , course and assignment name

Console.WriteLine("Name: "+ name);

Console.WriteLine("Course Name: "+ courseName);

Console.WriteLine("Assignment Name: "+ assignmentName);

// Displaying Question 1

Console.WriteLine("\nQuestion 1: Is the Carbon or Graphite Fiber is lighter than that of Aluminum or the steel?");

// Displaying options

Console.WriteLine("Answer [tex]$.1=$[/tex]Yes\nAnswer 2.= No");

// Prompting user to choose the correct answer

Console.WriteLine("Choose the correct answer");

// Taking input from the user and cnverting into int

answer = Convert.ToInt32(Console.ReadLine());

// Checking for the correct or wrong answer

String correct_or_wrong = 1 == answer ? "Correct": "Wrong";

// Displaying the result

Console.WriteLine(correct_or_wrong);

// Displaying Question 1

Console.WriteLine("\nQuestion 2: The [tex]$F/A-EF$[/tex] Super Hornet max speed is?");

// Displaying options

Console.WriteLine("Answer 1. = 890 MPH\nAnswer 2. = Mach 1.7\nAnswer 3. = Mach 2.9\nAnswer 4. = 967.3 MPH");

// Prompting user to choose the correct answer

Console.WriteLine("Choose the correct answer");

// Taking input from the user and cnverting into int

answer = Convert.ToInt32(Console.ReadLine());

// Checking for the correct or wrong answer

correct_or_wrong = 2 == answer ? "Correct": "Wrong";

// Displaying the result

Console.WriteLine(correct_or_wrong);

}

}