×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

C# Program to Implement Get Info Function Assignment Solution

July 10, 2024
Dr. Elizabeth Pearson
Dr. Elizabeth
🇺🇸 United States
Programming
Dr. Pearson holds a Ph.D. in Computer Science from Stanford University and has completed over 800 Programming assignments with exceptional results. With her expertise, she specializes in advanced Groovy concepts such as metaprogramming, DSLs, and concurrency. Dr. Pearson's in-depth understanding and practical experience make her a valuable asset in tackling complex programming challenges.
Key Topics
  • Instructions
  • Requirements and Specifications
Tip of the day
Use well-structured shaders to optimize rendering and ensure efficient resource management. Start with simple shapes, gradually adding complexity, and debug in small steps to identify errors easily.
News
An open-source framework that allows developers to create rich Python applications in the browser using HTML's interface, bridging the gap between web development and Python scripting.

Instructions

Objective

Write a C# assignment program to implement a 'get info' function in C#. This program should focus on creating a function that retrieves information and demonstrates your understanding of C# programming concepts.

Requirements and Specifications

program to implement get info function in Csharp

Screenshots

program to implement get info function in Csharp1

Source Code

PROGRAM using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AshmeeApp { class Program { static void Main(string[] args) { // Ask user for budget int budget = 0; Console.Write("Please enter your budget: $"); budget = Convert.ToInt32(Console.ReadLine()); // Create Retailer object Retailer retailer = new Retailer(); TV tv = retailer.replenishTV(budget); if(tv != null) // the tv object returned by Retailer is not null { // Display TV info Console.WriteLine("With a budget of $" + budget + " you can acquire the following TV:"); Console.WriteLine(tv.getInfo()); } // Execute a Console.Read so console is not closed until user presses a key Console.Read(); } } } RETAILER using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AshmeeApp { class Retailer { public TV replenishTV(int budget) { TV tvObject = null; if (budget >= 200) tvObject = new TV(); if (budget >= 250) tvObject = new Vizio_TV(); if (budget >= 280) tvObject = new Sony_TV(); if (budget >= 300) tvObject = new Smart_TV(); if (budget >= 350) tvObject = new Vizio_Smart_TV(); if (budget >= 380) tvObject = new Sony_Smart_TV(); if (budget >= 400) tvObject = new UltraHD_TV(); if (budget >= 450) tvObject = new Vizio_UltraHD_TV(); if (budget >= 480) tvObject = new Sony_UltraHD_TV(); return tvObject; } } }

Related Samples

At ProgrammingHomeworkHelp.com, we understand the challenges students face with C# assignments. That's why we offer a range of related sample assignments to guide and support your studies. Our expert-crafted samples cover various C# topics, from basic syntax to advanced object-oriented programming concepts, helping you grasp complex ideas and improve your coding skills. Whether you need help with a specific problem or want to understand C# better, our website provides comprehensive resources to assist you in achieving academic success. Let us help you excel in your C# assignments today!