Question

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Assignment06 {    class Program    {...

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assignment06
{
   class Program
   {
       static void Main(string[] args)
       {
           int age = 10;
           if (age >= 16)
           {
               Console.WriteLine("Error;Since you are " + age + " years old, you are legally unable to obtain a license.");
           }
           Console.Write("Hit any key to close"); Console.ReadKey(false);
       }
   }
}

need help with the output nothing returns?

Homework Answers

Answer #1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Assignment06
{
    class Program
    {
        static void Main(string[] args)
        {
            int age = 10;
            if (age < 16)
            {
                Console.WriteLine("Error;Since you are " + age +
                                  " years old, you are legally unable to obtain a license.");
            }

            Console.Write("Hit any key to close");
            Console.ReadKey(false);
        }
    }
}

Know the answer?
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
Similar Questions
What will be the output of the given code? using System; class MyProgram { static void...
What will be the output of the given code? using System; class MyProgram { static void Main(string[] args) { try { int a, b; b = 0; a = 5 / b; Console.WriteLine("No exception will occur."); } catch (ArithmeticException e) { Console.WriteLine("Exception occurs."); } finally { Console.WriteLine("Program is executed."); } Console.ReadLine(); } } A Program is executed. B No exception will occur. C Exception occurs. Program is executed. D No exception will occur. Program is executed.
What is the output of the following program? [ Explain the working of the while loop...
What is the output of the following program? [ Explain the working of the while loop in this program as per your understanding. namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int number = 100; while (true) { Console.WriteLine(number); number+=100; if (number <= 1000) continue; else break; } Console.ReadLine(); } } }
Identify the errors in the following C# program. Write the correct program. Explain the errors. class...
Identify the errors in the following C# program. Write the correct program. Explain the errors. class Program { static Main(string[] args) { int x = 10 Console.WriteLine("{0}" + x); Console.ReadLine(); }
Modify the C# program to allow it to calculate the average of three numbers instead of...
Modify the C# program to allow it to calculate the average of three numbers instead of the sum. then submit your program to This Drop Box. C# Program: using System; class MainClass { public static void Main (string[] args) { Console.WriteLine ("Hello World"); } }
In Java Let’s say we’re designing a Student class that has two data fields. One data...
In Java Let’s say we’re designing a Student class that has two data fields. One data field, called id, is for storing each student’s ID number. Another data field, called numStudents, keeps track of how many Student objects have been created. For each of the blanks, indicate the appropriate choice. id should be   public/private   and   static/not static . numStudents should be   public/private   and   static/not static . The next three questions use the following class: class Counter {     private int...
1) Consider the following Java program, which one of the following best describes "setFlavor"? public class...
1) Consider the following Java program, which one of the following best describes "setFlavor"? public class Food {     static int count;     private String flavor = "sweet";     Food() { count++; }     void setFlavor(String s) { flavor = s; }     String getFlavor() { return flavor; }     static public void main(String[] args) {         Food pepper = new Food();         System.out.println(pepper.getFlavor());     } } a. a class variable b. a constructor c. a local object variable d....
Fix the program: what if the input is three? import java.util.Scanner public class Test { public...
Fix the program: what if the input is three? import java.util.Scanner public class Test { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter an integer: "); int m = in.nextInt(); System.out.print("Enter another integer: "); int n = in.nextInt(); System.out.println(m + " " + n); } }
What is the output of the following Java program? public class Food {     static int...
What is the output of the following Java program? public class Food {     static int count;     private String flavor = "sweet";     Food() { count++; }     void setFlavor(String s) { s = flavor; }     String getFlavor() { return flavor; }     static public void main(String[] args) {         Food pepper = new Food();         pepper.setFlavor("spicy");         System.out.println(pepper.getFlavor());     } } Select one: a. sweet b. 1 c. The program does not compile. d. 2 e. spicy...
In Chapter 9, you created a Contestant class for the Greenville Idol competition. The class includes...
In Chapter 9, you created a Contestant class for the Greenville Idol competition. The class includes a contestant’s name, talent code, and talent description. The competition has become so popular that separate contests with differing entry fees have been established for children, teenagers, and adults. Modify the Contestant class to contain a field that holds the entry fee for each category, and add get and set accessors. Extend the Contestant class to create three subclasses: ChildContestant, TeenContestant, and AdultContestant. Child...
Mention the concepts analyzed from the below given program and write the output. [0.5 M] class...
Mention the concepts analyzed from the below given program and write the output. [0.5 M] class Test { int a, b; Test(int i, int j) { a = i; b = j; } void meth(Test s) { s.a *= 2; s.b /= 2; } } class demo { public static void main(String args[]) { Test ob = new Test(15, 20); System.out.println("Before call: " + ob.a + " " + ob.b); ob.meth(ob); System.out.println("After call: " + ob.a + " " +...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT