The image for this code is below. I need help fixing this code to be inside of C#, and work as intented please (reject if you can't do C#). Screenshot of output would be great. using System; namespace GlobalWarming; int private main() //main function { int count = 0, option1, option2, option3, option4, option5; //declaring required variables Console.WriteLine("Question 1:\n"); //printing question 1 Console.WriteLine("Which one of the following cause global warming?\n"); Console.WriteLine("1) Carbon dioxide\n2) Oxygen\n3) Nitrogen\n4) Hydrogen\n"); Console.WriteLine("Enter the correct option: "); //asking user to enter the answer cin >> option1; //storing the answer in option1 variable if (option1 == 1) //checking if the answer is correct { count++; //incrementing count variable if answer is correct } Console.WriteLine("Question 2:\n"); //printing question 2 Console.WriteLine("How many percent of carbon dioxide increased in the atmosphere since pre-industrial times?\n"); Console.WriteLine("1) About 10%\n2) About 20%\n3) About 30%\n4) About 40%\n"); Console.WriteLine("Enter the correct option: "); //asking user to enter the answer cin >> option2; //storing the answer in option2 variable if (option2 == 3) //checking if the answer is correct { count++; //incrementing count variable if answer is correct } Console.WriteLine("Question 3:\n"); //printing question 3 Console.WriteLine("Who measures the global warming rate?\n"); Console.WriteLine("1) Astrologers\n2) Physicist\n3) Philosopher\n4) Climatologist\n"); Console.WriteLine("Enter the correct option: "); //asking user to enter the answer cin >> option3; //storing the answer in option3 variable if (option3 == 4) //checking if the answer is correct { count++; //incrementing count variable if answer is correct } Console.WriteLine("Question 4:\n"); //printing question 4 Console.WriteLine("Human activities cause global warming. True or False?\n"); Console.WriteLine("1) True\n2) False\n"); Console.WriteLine("Enter the correct option: "); //asking user to enter the answer cin >> option4; //storing the answer in the option4 variable if (option4 == 1) //checking if the answer is correct { count++; //incrementing count variable if answer is correct } Console.WriteLine("Question 5:\n"); //printing question 5 Console.WriteLine("Which one of the following cause global warming?\n"); Console.WriteLine("1) Radiative forcing\n2) Earth gravitation force\n3) Oxygen\n4) Centripetal force\n"); Console.WriteLine("Enter the correct option: "); //asking user to enter the answer cin >> option5; //storing the answer in the option5 variable if (option5 == 1) //checking if the answer is correct { count++; //incrementing count variable if answer is correct } if (count == 5) //checking if all answers are correct { Console.WriteLine("Excellent"); //if yes printing Excellent } else if (count == 4) //checking if 4 answers are correct { Console.WriteLine("Very good"); //if yes printing Very good } else if (count < 4) //checking if total number of correct answers are less than 4 { //if yes printing links to some websites Console.WriteLine("Time to brush up on your knowledge on global warming\n"); Console.WriteLine("Here are links to some websites:\n"); Console.WriteLine("https://en.wikipedia.org/wiki/Global_warming\n"); Console.WriteLine("https://www.nrdc.org/stories/global-warming-101\n"); Console.WriteLine("https://www.nationalgeographic.com/environment/global-warming/global-warming-overview/"); } return 0; }
The image for this code is below. I need help fixing this code to be inside of C#, and work as intented please (reject if you can't do C#). Screenshot of output would be great.
using System;
namespace GlobalWarming;
int private main() //main function
{
int count = 0, option1, option2, option3, option4, option5; //declaring required variables
Console.WriteLine("Question 1:\n"); //printing question 1
Console.WriteLine("Which one of the following cause global warming?\n");
Console.WriteLine("1) Carbon dioxide\n2) Oxygen\n3) Nitrogen\n4) Hydrogen\n");
Console.WriteLine("Enter the correct option: "); //asking user to enter the answer
cin >> option1; //storing the answer in option1 variable
if (option1 == 1) //checking if the answer is correct
{
count++; //incrementing count variable if answer is correct
}
Console.WriteLine("Question 2:\n"); //printing question 2
Console.WriteLine("How many percent of carbon dioxide increased in the atmosphere since pre-industrial times?\n");
Console.WriteLine("1) About 10%\n2) About 20%\n3) About 30%\n4) About 40%\n");
Console.WriteLine("Enter the correct option: "); //asking user to enter the answer
cin >> option2; //storing the answer in option2 variable
if (option2 == 3) //checking if the answer is correct
{
count++; //incrementing count variable if answer is correct
}
Console.WriteLine("Question 3:\n"); //printing question 3
Console.WriteLine("Who measures the global warming rate?\n");
Console.WriteLine("1) Astrologers\n2) Physicist\n3) Philosopher\n4) Climatologist\n");
Console.WriteLine("Enter the correct option: "); //asking user to enter the answer
cin >> option3; //storing the answer in option3 variable
if (option3 == 4) //checking if the answer is correct
{
count++; //incrementing count variable if answer is correct
}
Console.WriteLine("Question 4:\n"); //printing question 4
Console.WriteLine("Human activities cause global warming. True or False?\n");
Console.WriteLine("1) True\n2) False\n");
Console.WriteLine("Enter the correct option: "); //asking user to enter the answer
cin >> option4; //storing the answer in the option4 variable
if (option4 == 1) //checking if the answer is correct
{
count++; //incrementing count variable if answer is correct
}
Console.WriteLine("Question 5:\n"); //printing question 5
Console.WriteLine("Which one of the following cause global warming?\n");
Console.WriteLine("1) Radiative forcing\n2) Earth gravitation force\n3) Oxygen\n4) Centripetal force\n");
Console.WriteLine("Enter the correct option: "); //asking user to enter the answer
cin >> option5; //storing the answer in the option5 variable
if (option5 == 1) //checking if the answer is correct
{
count++; //incrementing count variable if answer is correct
}
if (count == 5) //checking if all answers are correct
{
Console.WriteLine("Excellent"); //if yes printing Excellent
}
else if (count == 4) //checking if 4 answers are correct
{
Console.WriteLine("Very good"); //if yes printing Very good
}
else if (count < 4) //checking if total number of correct answers are less than 4
{
//if yes printing links to some websites
Console.WriteLine("Time to brush up on your knowledge on global warming\n");
Console.WriteLine("Here are links to some websites:\n");
Console.WriteLine("https://en.wikipedia.org/wiki/Global_warming\n");
Console.WriteLine("https://www.nrdc.org/stories/global-warming-101\n");
Console.WriteLine("https://www.nationalgeographic.com/environment/global-warming/global-warming-overview/");
}
return 0;
}


Step by step
Solved in 3 steps with 2 images









