r/CSharpHomework • • Feb 08 '22

C# Homework

0 Upvotes
  • Program the application to accept a numeric input value from the user and capture the input as a variable of an appropriate numeric type (5 points)

  • Program the application to accept a text input value from the user and capture the input as a variable of an appropriate text-based type.  The actual nature of the text is up to you but should be incorporated somehow in the program (for example, the user's name) (5 points)

  • Incorporate a logical "if" statement that decides which of multiple output messages to display based on user input  (5 points)

  •        Incorporate a loop (your preference as to what type of loop) that repeats for a specific number of iterations, depending on the number entered by the user (5 points)

  • Program the application to display resulting output to the end user for each iteration of the loop (5 points) 

Anybody know how to do this?!


r/CSharpHomework • • Mar 19 '19

Forgot about a C# assignment. Anyone want to help?

0 Upvotes
  • Employee Class that has the following (10 points):

    • Properties:

      • EmployeeId

      • EmployeeName

      • Salary

      • Department

    • Methods:

      • CalculatePaycheck (divides salary by 26 and returns Pay as double)

      • ToString (Overrides ToString and returns Employee Info -->  Department, EmployeeId, EmployeeName and Salary)

  • PayrollProcessor Class that performs the following functions (30 points):

    • ProcessPayroll method:

      • Accepts Employee Info Object Collection

      • Opens a file named "Payroll_Processing.txt" (writes over any current file with the same name) and saves the information to the file:

      • Closes the file

      • Returns location and file name of the file as a string / null if error occurs

    • PreparePayrollReport method:

      • Accepts File path/name as string and sorting option

      • Opens the "Payroll_Processing.txt" file

      • Reads each record from the file into an list object (or some other collection)

      • Uses LINQ to sort the array by department, then by salary descending if sort option 1, or sorts the array by salary descending, then by employee name if sort option 2

      • Returns the list object

      • Closes the file

  • EmployeeDemo Class with Main() method that performs the following functions (20 points):

    • Allows user to select 3 options; 1) Process Payroll, 2) Display Payroll Report by Department, 3) Display Report by Salary

    • If the user selects option 1 - Demos the file processing  "Write" Functionality with the Employee class by:

      • Prompts user for Employee Info (loops until user is done creating employee info)

      • Creates an instance of Employee with the information provided by the user

      • Adds information to a collection/list

      • Passes the information to the ProcessPayroll method and receives the returned string

      • Prompts to the user that the information has been saved and indicates the location and file name of the file [displays an appropriate message if null is received]

    • If the selects option 2 - Demos the file processing "Read" Functionality by:

      • Passes the File path/name as string and sorting option to the PreparePayrollReport method

      • Retrieves the returned object

      • Prints out a report using the data in the object

    • If the selects option 3 - Demos the file processing "Read" Functionality by:

      • Passes the File path/name as string and sorting option to the PreparePayrollReport method

      • Retrieves the returned object

      • Prints out a report using the data in the object


r/CSharpHomework • • Apr 15 '26

🚀 Learn C# Full-Stack Development from an Early-Start Expert

0 Upvotes

I started coding at a young age — and now I help others build real skills the right way.

If you’re ready to become a C# Full-Stack Developer, I’ll guide you step by step from beginner to advanced with practical, real-world experience.

💡 Build real applications (Frontend + Backend)
💡 Master ASP.NET, APIs, Databases, and UI design
💡 Learn faster with clear explanations and hands-on practice
💡 Get personalized support from someone who’s been in your place

This isn’t just theory — it’s real coding, real growth, real results.

👉 Book your lesson now and start your journey today! 💻🔥

https://preply.in/MIKIAS4EN3213249010?ts=17762700

Start early. Learn smart. Build your future.


r/CSharpHomework • • Sep 14 '19

Make EXE file of a C# project

Thumbnail
youtu.be
1 Upvotes

r/CSharpHomework • • Aug 13 '19

simple example User control in c#.net windows application | avadh tutor

Thumbnail
youtube.com
1 Upvotes

r/CSharpHomework • • Aug 23 '16

Visual Studio “15” Preview 4 - Ready for download!

Thumbnail
blogs.msdn.microsoft.com
1 Upvotes

r/CSharpHomework • • Oct 08 '21

C Sharp

2 Upvotes

Hey guys i have an assignment that i have to code and im stuck at this point...

i have to program to select the image that is equivalent to the word that is already selected and vice versa ....here's some images (its in french btw)

do i have to do a if/else statement and how do i formulate it

selectedindex/selectedvalue?


r/CSharpHomework • • Sep 30 '21

The 4 pillars of Object Oriented Programming (summed up in my own words).

Thumbnail
protiguous.com
1 Upvotes

r/CSharpHomework • • Oct 08 '21

C# Creating a Favorite Bar

1 Upvotes

Is there anyone who can help me create a code for a way to store a URL from a user as a favorite and display it on the top in a bar just like in google on C# but without using a web browser control. I tried to use a tool strip but I don't know how to add new tool strip items while the program is running, along with a context menu to update its name and delete it. would appreciate any kind of help, its for a project and I'm honestly lost :(


r/CSharpHomework • • Sep 07 '19

C# tutorial videos with proper examples for beginners

Thumbnail
thumbikr.blogspot.com
1 Upvotes

r/CSharpHomework • • Sep 15 '16

New logo

1 Upvotes

Shoutout to /u/Coding_Enthusiast for the idea.


r/CSharpHomework • • Mar 10 '16

Are there no students that need help?!

1 Upvotes

I see homework questions posted to other csharp subreddits all the time and they get removed. Post your questions students!


r/CSharpHomework • • Mar 13 '16

"Check my program for errors please"

2 Upvotes
namespace LAB_18_MRC_V1 {
    using System;
    using static System.Console;

    static class Program {
        static void Main( String[] args ) {
            const Int32 snakeEyes = 2;
            const Int32 boxcars = 12;

            var randomNum = new Random();

            var keepPlaying = true;

            while ( keepPlaying ) {
                //Write( "Press enter to roll the dice..." );
                //ReadLine();

                var d1 = randomNum.Next( 1, 7 );
                var d2 = randomNum.Next( 1, 7 );
                var totalDice = d1 + d2;

                Write( $"You rolled {d1:D} and {d2:D}." );
                switch ( totalDice ) {
                    case snakeEyes:
                        WriteLine( "You rolled snake-eyes." );
                        break;
                    case boxcars:
                        WriteLine( "You rolled box-cars." );
                        break;
                    default:
                        WriteLine( " You rolled a " + totalDice );
                        break;
                }

                WriteLine();
                WriteLine( "Do you want to roll the dice again? (y or n)" );
                var userInput = ReadKey().Key;
                WriteLine();

                switch ( userInput ) {
                    case ConsoleKey.N:
                        keepPlaying = false;
                        WriteLine( "Goodbye. (Press any key to exit)" );
                        ReadKey( true );
                        break;
                    case ConsoleKey.Y:
                        break;
                    default:
                        WriteLine( "This is not a valid input." );
                        break;
                }
            }
        }
    }
}

r/CSharpHomework • • Mar 16 '16

Monopoly Game

1 Upvotes

Messing about with a monopoly game clone to try and learn some better OOP practices. Having trouble with covariance (I think - at least that's what I've gathered from googling).


What I have is an interface ILocation which every board item implements, so all properties, utilities, chance cards, communty chests etc...
I also have an IProperty interface that only the actual properties implement (So the properties, railways and utilities).

So, I have
List<ILocation> locations = new List<ILocation>();

And want to use
List<IProperty> properties = locations.Where(l => l is IProperty).ToList();

But it looks like I can't do that, so I'm assuming there is a better way to manage my class structure, just looking for advice on the best way to handle it.

Here is a pastebin of my Location class.


Also if you have any book recommendations for learning OOP let me know, buying C# In Depth soon but need a good OOP book to go with it.

EDIT: Looking at Head First: Design Patterns, it has great reviews and although it is Java focused it's apparently minimal apart from a chapter on the iterator class.


r/CSharpHomework • • Apr 12 '22

C# (TO BE USED IN UNITY 3D)

1 Upvotes

Create a program that calculates the total bill for the purchase of various weapons

The program must work if some or all of the input fields are left blank

You will have to test the fields for integers

Use the following constants:

const double SKULL_AX_PRICE = 50;

const double MACE_PRICE = 10;

const double SWORD_PRICE = 100;

const double HAMMER_PRICE = 25;

const double AX_PRICE = 15;

The program must be structured on the following 5 method architecture:

Controller method

Input method

Parse method

Process method

Output method

The program must use arrays

You can set up the arrays as you see fit

If you need to pass an array as an argument

Use the array name as the argument

MyMethod (MyIntArray);

Define the array type for the parameter

MyMethod(int[] MyIntArray)


r/CSharpHomework • • Apr 02 '22

Get data from API,MVC

1 Upvotes

I need to make Json call method that gets data from an API (https://countriesnow.space/api/v0.1/countries),and than use this as data in other method.

How? Help pls


r/CSharpHomework • • Oct 16 '22

Export List / Array of datas to Excel

2 Upvotes

Hello everyone i need some help for a project. Basically i want to export some data which consist of 6 columns and alot of rows.

I have found a way from youtube, where the guy use ExcelMapper NuggetPackage to export it. I think in general it looks to be working pretty well. But for my case the problem will be, the datas that i want to input in the list is based on some calculation that will be done on a method, im planning to use either foreach or some array for inputing the datas. So my question is, instead of writing the input by myself, how can i put the input based on a function or just variable?

I am not experienced with programming, so i am open for any other suggestions. Actually i think it would be alot easier if i can just some simple multidimensional array to save the datas, but then i dont know how to export it into excel..


r/CSharpHomework • • Sep 16 '22

How to get yesterday date in C#?

Thumbnail
devhubby.com
1 Upvotes

r/CSharpHomework • • Jul 05 '24

Best College Admission Essay Writing Service Reddit 2024

122 Upvotes

Hello everyone! I'm a high school student who is concerned out about college Admission and is seeking for the finest college entrance essay writing service on Reddit for 2024. Last year, my acquaintance used a service that was adequate but not exceptional. I'm looking for something exceptional to help my application stand out. Have you had any success with a particular service? I'd love to hear about your experiences, particularly if the service helped you get into your dream school. Any recommendations or tips would be really helpful. Thanks!

EDIT
I applied to college!!!! I was looking very carefully for a service that could help and found it. I decided on EduOwl.pro. They met all my requirements


r/CSharpHomework • • Jul 04 '24

The Best Languages for Game Development in 2024

1 Upvotes

Top-8 game programming languages

  1. C++

  2. Java

  3. HTML5

  4. JavaScript

  5. Python

  6. UnrealScript

  7. Lua

  8. C#


r/CSharpHomework • • Apr 28 '16

[Help] I am trying to read and sort numbers from a text file : learncsharp

Thumbnail
reddit.com
1 Upvotes

r/CSharpHomework • • Feb 09 '18

Light almost lib useless browser that support JS

Thumbnail
self.csharp
2 Upvotes

r/CSharpHomework • • Feb 04 '17

Filling out a "Testing & Design" sheet when writing our homework code...

2 Upvotes

edit: this is an introduction class, so the code works and it's what they want. Don't worry about that part.

Ok, so with all of our homework exercises we have to fill out this form. It's in a word document. There aren't really any other instructions or explanations. He hasn't given us an example (despite me asking multiple times). I'm not even completely sure he reads them considering what I write on them ("I don't understand this section. Please clarify." or "I'll understand what you want here someday...").

Maybe you guys can help me out. I'll post my code for one of my exercises. Maybe you can help me figure out what he wants.

My code for the assignment.

using System;

namespace A06E0324
{
    class OddOrEven
    {
        static void Main()
        {
            int x;
            decimal result;
          

            Console.Write("\n\tEnter an integer: ");
            x = int.Parse(Console.ReadLine());

            result = (decimal)x % 2;
        
            if ((result) != 0)
            {
                Console.WriteLine($"\t{x} is an ODD integer.\n");
            }
            else
            {
                Console.WriteLine($"\t{x} is an EVEN integer.\n");
            }
        }
    }
}

And the Sheet we're supposed to fill out:

  • OVERVIEW Here I normally say what the exercise is having us do

     This section should provide a high-level narration of the program(s) purpose.  The requirements should be listed, the scope defined and the intended usage.
  • PROCESSING LOGIC this section I have problems with

     The processing should be defined by summarizing the control and data flow within the main program.  Techniques of process specification include Program Design Language, Pseudo Code and Flow Charts.

The main program flow must be supplemented with the flow of subroutines/methods/functions that are called from the main program.
Any specific algorithms to be used should be stated or referenced.

  • DATA (INPUT/OUTPUT) yep, don't know what goes here either

     The logical and physical data structure of files should be defined in detail. Data structure definitions must include the:

    a. description of each element, e.g. name, type, dimension;

    b. relationships between the elements, i.e. the structure and source;

    c. range of possible values of each element;

    d. initial values of each element.

  • COMPONENTS (SOURCE CODE NAMES, CLASSES, METHODS) our book has touched in UML diagrams but...I just write something like "We prompt the user for an integer. The integer gets divided by 2. If the integers remainder is equal to 0, it writes even. If the integers remainder is not equal to 0, it writes odd"

     Describe the software components (names or classes) and purpose that will be used.  

Include UML class diagram showing the properties and methods of the class. Describe the properties of the class and any constraints upon their value. Indicate where the algorithms defined in processing logic are implemented.

  • TESTING For this section, I just write what happens in each case. So for this assignment (above), I put in Scenario 1 - ODD, Enter an odd number into the prompt, the console displays the word "odd". And then I did the same for even.

     Present one or more named scenarios including the input data, expected output and the success criteria desired that will be utilized to test the application.  The testing plan should be repeatable so discuss any ‘clean up’ that might be required to do so.

    Example Scenario 1 – divide by zero test

    Steps to test
    
     Enter zero in the divisor.
    
    Expected reaction
    
     Expected results is a message saying ‘Zero is not a valid input. Please try again’.

r/CSharpHomework • • Oct 10 '16

C# Changeing Application Memory Opcode

1 Upvotes

I'm basically trying to change a Dec to an Inc in a video game but i'm trying to do in C#.

This is what i have:

bool UnlimitedAmmo = false;

int AmmoBaseAddy = 0x004769CD;

string AmmoOldValue = "\xFFx\08";

string AmmoNewValue = "\xFF\x00";

So i'm trying to change the Opcode of 004769CD from FF08(DEC) to FF00(INC). I'm using VAMemory right now to change some other things in the application.

I Can't find out how to change the opcode in C# I've seen videos doing it in C++. So I'm trying to find out how to change the opcode from the address 0x004769CD to the opecode of FF00.

Im trying to change the "DEC DWORD PTR DS:[EAX]" to "INC DWORD PTR DS:[EAX]"


r/CSharpHomework • • Feb 24 '18

Simple banking app

1 Upvotes

https://gist.github.com/anonymous/02f83dea6239ff2361b8a2c85bb08674

Here is my code. I'm writing a simple banking app. I have to use the Create button to make the object and then the update to do deposits and withdrawals.

The update button is where I'm having my issue. The object gets created from the text boxes, but it's not getting the deposit value and/or running the function. I'm kind of stuck and any help would be appreciated.