100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Unit 4 Programming Assignment 2 Code $7.18   Add to cart

Essay

Unit 4 Programming Assignment 2 Code

 87 views  0 purchase
  • Course
  • Institution

This is the code for Unit 4 Assignment 2. It is necessary for passing the unit although the code itself is only worth a pass criteria as you can see below. The Program has been made using the programming language C# **Criteria Covered ** D3 Demonstrate individual responsibility, creativit...

[Show more]

Preview 2 out of 6  pages

  • October 2, 2022
  • 6
  • 2021/2022
  • Essay
  • Unknown
  • A+
avatar-seller
using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
struct employee
{
public string name;
public int id;
public int totalpropsold;
public double commission;

}



static employee NewEmployee(int id)
{
employee temp = new employee();
bool validcheck, entrycheck;
string confirm;

do
{
entrycheck = true;

do
{
validcheck = true;
Console.Write("Please enter your full name: ");
temp.name = Console.ReadLine();
if (temp.name.Any(c => !char.IsLetter(c)))
{
Console.WriteLine("You have not entered a
name.");
validcheck = false;
}
else if(temp.name == "")
{
Console.WriteLine("Please enter a name do not
leave the field blank.");
validcheck = false;
}



} while (validcheck != true);

do
{
validcheck = true;

, Console.Write("Please enter your unique 4 digit
ID: ");
bool parseCheck =
int.TryParse(Console.ReadLine(), out temp.id);
if (parseCheck == false)
{
Console.WriteLine("Invalid. You must enter a
numeric value");
validcheck = false;
}
else if (temp.id > 9999)
{
Console.WriteLine("Invalid. Your unique ID
must be 4 digits");
validcheck = false;
}
else if (temp.id < 1000)
{
Console.WriteLine("Your ID must be 4
digits");
validcheck = false;
}


} while (validcheck != true);

do
{
validcheck = true;
Console.Write("Please enter the number of
properties you have sold this week: ");
bool parseCheck = int.TryParse(Console.ReadLine(),
out temp.totalpropsold);
if (parseCheck == false)
{
Console.WriteLine("Invalid. Please enter a
number");
validcheck = false;
}

} while (validcheck != true);

do
{
validcheck = true;
Console.Write("Please confirm that you name is " +
temp.name + " and you have sold " + temp.totalpropsold + " Properties
[y/n]");
confirm = Console.ReadLine().ToLower();
if (confirm != "y" && confirm != "n")
{

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller adilhass. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.18. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79373 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.18
  • (0)
  Add to cart