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
-
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...
-
You have two springs that are identical except that spring 1 is stiffer than spring 2 (k1 > k2). On which spring is more work done (a) If they are stretched using the same force, (b) If they are...
-
Considering the information in the previous problem, how much life insurance should they purchase for Mary?
-
Harold Fail owned a plot of land in Georgia known as Ebenezer Landing, where he operated a public boat ramp and parking lot. In 1999, Fail and Steve Bodiford entered into an oral agreement...
-
Lowell Companys manufacturing overhead budget for the first quarter of 2012 contained the following data. Actual variable costs were: indirect materials $13,800, indirect labor $9,600, utilities...
-
1. A clothes dryer rates at 4000 W runs for 1.50 hours each day. it uses utility power at 240 V. how much current does the dryer use? 2. For the clothes dryer in the previous question, how much does...
-
Suzi Nomro operates Watercraft Supply Company, an online boat parts distributorship that is in its third year of operation. The following income statement was prepared for the year ended October 31,...
-
Complete the following sentence: Inflation occurs when inventory costs are rising over time whereas deflation occurs when inventory costs are declining over time
-
Identify one of the companies below that integrates sustainable practices into their strategy and operations. Question 2Answer a. Company B: A tech startup that promotes renewable energy solutions b....
-
What are the advantages for both an LLC (taxed as a partnership) and a Corporation when it comes to liquidation?
-
What form should the offer take, and how should the offer be financed? Support your recommendations on qualitative analysis (a forecast of financial information and ratios is not expected)
-
Tesco is a British multinational grocery and general merchandise retailer, with a market capitalisation of 22.75 billion as of January 2022. Tesco International Sourcing Supplier Manual: "We are a...
-
Calculate the flowing: Return on assets Net income/assets Company A Return on equity Net income/equity Return on sales Net income/Sales
-
Cullumber Company purchased a delivery truck. The total cash payment was $ 33,638 , including the following items. Negotiated purchase price $ 25,800 Installation of special shelving 1,710 Painting...
-
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...
-
Last year, Miley decided to terminate the S corporation election of her solely owned corporation on October 17, 2018 (effective immediately), in preparation for taking it public. At the time of the...
-
You have been assigned to compute the income tax provision for Motown Memories Inc. (MM) as of December 31, 2019. The companys income statement for 2019 is provided below: MM prepared the following...
-
Jane has been operating Mansfield Park as a C corporation and decides she would like to make an S election. What is the earliest the election will become effective under each of these alternative...
Study smarter with the SolutionInn App