100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Essay

Unit 4 Programming Assignment 2 Code

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
02-10-2022
Written in
2021/2022

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, creativity and effective self-management management in the design, development and review of the computer program D2 Evaluate the final design and optimised software application against client requirements M2 Justify design decisions, showing how the design will result In an effective solution M3 Optimise the computer program to meet client requirements P4 Produce a design for a computer program to meet client requirements PS Review the design with others to identify and inform improvements to the proposed solution P6 Produce a computer program that meets client requirements P7 Review the extent to which the final computer program meets client requirements

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
October 2, 2022
Number of pages
6
Written in
2021/2022
Type
Essay
Professor(s)
Unknown
Grade
A+

Content preview

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")
{

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
adilhass myself
View profile
Follow You need to be logged in order to follow users or courses
Sold
174
Member since
3 year
Number of followers
136
Documents
15
Last sold
2 months ago

3.9

20 reviews

5
11
4
2
3
3
2
1
1
3

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions