Find three C# syntax errors in the code below and rewrite the code in correct way?...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Find three C# syntax errors in the code below and rewrite the code in correct way? (4 marks) public class AgeCalc { public static void Main(string[] args) { } Console.iteLine ("Welcome to my Age Calculator"); Console.Write("What is your year of birth? ") int year=Convert.Toln32(console.ReadLine()); int age=2022-year Console.Write("My age is: "+age); Find three C# syntax errors in the code below and rewrite the code in correct way? (4 marks) public class AgeCalc { public static void Main(string[] args) { } Console.iteLine ("Welcome to my Age Calculator"); Console.Write("What is your year of birth? ") int year=Convert.Toln32(console.ReadLine()); int age=2022-year Console.Write("My age is: "+age);
Expert Answer:
Answer rating: 100% (QA)
The WriteLine method is misspelled as iteLine The Readline method is misspelled as ReadLine The ConvertToDouble32 method should be ConvertToInt32 beca... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these programming questions
-
Simplify and write your answer in the form a + bi. 5 2+1
-
Declare and assign these variables as shown (all your code must appear in the body of the main method): String firstName = "Blueberry"; String lastName = "Strawberry"; In addition, declare and...
-
How do you simplify the max method in the following, using the conditional operator? 1: /** Return the max of two numbers */ 2: public static int max ( int num1, int num2 ) { 3: int result; 4: 5: if...
-
A company reports the following: Net income ............. $115,000 Preferred dividends .......... $15,000 Shares of common stock outstanding ... 20,000 Market price per share of common stock . $65.00...
-
Why is the account Dividends not closed with the expense accounts?
-
Use a search engine to find information on the kidnapping and murder of the son of the famous pilot Charles Lindbergh. What did President Franklin D. Roosevelt do that aided the FBI in determining...
-
DiCaprio Company reports operating expenses of \($270,000\) excluding depreciation expense of \($45,000\) for 2002. During the year prepaid expenses decreased \($19,800\). and accrued expenses...
-
How can marketers exploit the characteristics of the Internet to improve the product element of the marketing mix?
-
Part 1 of 2 Points: 0 of 1 Save (Future value of a complex annuity) Springfield mogul Montgomery Burns, age 85, wants to retire at age 100 so he can steal candy from babies full time. Once Mr. Burns...
-
You own a flooring company that sells the following items. Product Premium Carpet Basic Carpet Luxury Vinyl Flooring Standard Vinyl Flooring Delivery Fee Installation Price $4.00 / square ft....
-
11.6 Score: 36.67/140 4/14 answered O Question 5 T < > Complete the parametric equations for the line where the planes -2x-4y-4x=-8 and -15x y 10z = -29 intersect. x(t) = 36t: y(t) = z(t) = Question...
-
Why don't governments like private issues of money, or even foreign currency, being used in their countries, and try to monopolise the issue of domestic money?
-
Olourun Ltd is the major employer in the Front Hill area, where the firm is located. The company is considering the acquisition of a new production line. The equipment would cost$720 000 and...
-
What are the various stages of the budgeting process, elaborate each step, which types of budgets are widely used, and address briefly the benefits and disadvantages of each.
-
This game of cactus basketball was a work event. Both the immediate supervisor, Rover, as well as the program director knew of the event and participated in it. Make an argument in favor of Charlie's...
-
If operations run on less than full capacity, what is the result on cost driver rates?
-
. Identify the choices that uses one of - > more transition cossectly alIt was a fourteen- hour flight. I had plenty of time to write a solid draft of my paper . It was a fourteen- hour flight, g...
-
What are the typical record-at-a-time operations for accessing a file? Which of these depend on the current file record?
-
When the code that follows runs on an ArrayList of String s, it throws an exception. Why? for (String s: words) { System.out.println (s); if (s.equals ("hello")) { words.add ("goodbye"); }
-
Consider the following implementation of the contains method. How does it differ from the one we showed in Section 17.4 ? Is it better or worse, and why? private boolean contains (IntTreeNode root,...
-
Write a method called countCoins that accepts a Scanner representing an input file whose data is a series of pairs of tokens, where each pair begins with an integer and is followed by the type of...
-
In the late 19th century, more than half of all Americans lived on farms. New farming techniques, based on science, were being developed through university research, but older generations of farmers...
-
Review the minutes of recent meetings by Bank of Japan officials. Summarize at least one recent meeting that was associated with possible or actual intervention to affect the yens value.
-
Why might the foreign exchange intervention strategies of the Bank of Japan be relevant to the U.S. government and to U.S.-based MNCs?
Study smarter with the SolutionInn App