Programming Fundamentals Repeat Assessment Create a folder called RepeatMyName, where MyName is your name. For example, if I were creating it, the folder would be called RepeatElaineTynan. Save all...

1 answer below »
all information is on the file uploaded


Programming Fundamentals Repeat Assessment Create a folder called RepeatMyName, where MyName is your name. For example, if I were creating it, the folder would be called RepeatElaineTynan. Save all your projects in this folder. When you are complete, zip this folder with all 4 projects inside, and submit it to moodle. You will have to explain your code to your lecturer in a scheduled meeting via MS Teams. Repeat Exercise 01 – controls Create a C# project called Repeat01. Use C# to design the following form. Be sure to name the controls correctly using the correct prefixes (as shown below). There is no need to put values in the List Box, Text Box or Combo Box. Programming Fundamentals Control Naming Control Type Prefix Label lbl Test Box txt Button btn Radio Button rad Combo Box cbo Check Box chk Group Box grp List Box lst Repeat Exercise 02 – Selection and Iteration Create a C# console app project called Repeat02a. • Read a whole number (int) from the user. • If the number is divisible by 4, print to the console: “This is divisible by 4”. • If the number is not divisible by 4, print to the console: “n is not divisible by 4”, where n is the number entered by the user. Create a C# console app project called Repeat02b. • Read in 2 whole numbers (ints) from the user. • Using a loop, print all the odd numbers between the 2 numbers entered. Programming Fundamentals Repeat Exercise 03 – Forms Create a C# project called Repeat03. Use C# to design the following form. Be sure to name the controls correctly using the correct prefixes (as shown in Exercise 1). The user should be able to enter data about each hire transaction in the text boxes. When the OK button is clicked these values should then be displayed in a list box in table form as in the figure below. The Total Cost should be calculated by multiplying the Number of Days Hire by the Cost Per Day. Programming Fundamentals • Create a global variable called myFormat (i.e. not in any method but still inside the form’s class) – all on one line as follows: String MyFormat = "{0,-12}{1,-20}{2,-12}{3,-16} {4,-12}"; • Double-click on the form to get the code for the form’s Load event and create the table headings (heading only, do not enter any data) in the list box by entering the following all on the one line: (Note: My list box is named lstOutput) lstOutput.Items.Add(String.Format(MyFormat, "Prod Code", “Description", "Days Hire", "Cost Per Day", "Total Cost")) • For btnOk we need to code the following: • Create 5 suitable variables (i.e. decide whether they should be string, int or double) to store the values entered by the user and one also to store the total cost calculation. Choose suitable names for each – remember: no spaces in variable names!!!! • Set each variable equal to the text property of the appropriate text box. • Number of Days Hire and Cost Per Day variables will need to be converted (Parsed) to int, as you cannot multiply strings. • Assign TotalCost = Number of Days Hire x Cost per day • Use the following line (all one line) to output to the list box: lstOutput.Items.Add(String.Format(MyFormat, Code, Description, NumDays, Format(CostPerDay, "Currency"), Format(TotalCost, "Currency"))) • Set the text property of the four text boxes to “” so that the boxes are cleared. Note: Try to do as much of this as possible. The more you do, the better your marks will be. All projects should be saved in the folder called RepeatMyName, where MyName is your name (e.g., RepeatElaineTynan). This folder should then be zipped and uploaded at the link called Repeat Autumn Assessment Upload on the Business Programming Fundamentals moodle page. The assessment is due no later than Sunday August 15th 2021 at 23:59. You will be invited to meet with your lecturer on MS Teams to explain your code.
Answered 1 days AfterAug 11, 2021

Answer To: Programming Fundamentals Repeat Assessment Create a folder called RepeatMyName, where MyName is your...

Manjunath answered on Aug 12 2021
141 Votes
RepeatMyName/Repeat01/Repeat01.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Repeat01", "Repeat01\Repeat01.csproj", "{91CB457D-68C3-48B0-8C83-6CEAB61DA28A}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {91CB457D-68C3-48B0-8C83-6CEAB61DA28A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {91CB457D-68C3-48B0-8C83-6CEAB61DA28A}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {91CB457D-68C3-48B0-8C83-6CEAB61DA28A}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {91CB457D-68C3-48B0-8C83-6CEAB61DA28A}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal
RepeatMyName/Repeat01/Repeat01.v11.suo
RepeatMyName/Repeat01/Repeat01/App.config




RepeatMyName/Repeat01/Repeat01/bin/Debug/Repeat01.exe
RepeatMyName/Repeat01/Repeat01/bin/Debug/Repeat01.exe.config




RepeatMyName/Repeat01/Repeat01/bin/Debug/Repeat01.pdb
RepeatMyName/Repeat01/Repeat01/bin/Debug/Repeat01.vshost.exe
RepeatMyName/Repeat01/Repeat01/bin/Debug/Repeat01.vshost.exe.config




RepeatMyName/Repeat01/Repeat01/bin/Debug/Repeat01.vshost.exe.manifest









RepeatMyName/Repeat01/Repeat01/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using Syst
em.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Repeat01
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

}
}
RepeatMyName/Repeat01/Repeat01/Form1.Designer.cs
namespace Repeat01
{
partial class Form1
{
///
/// Required designer variable.
///

private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///

/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.lstlistBox = new System.Windows.Forms.ListBox();
this.lblGroupboxlabel = new System.Windows.Forms.Label();
this.grGroupBox = new System.Windows.Forms.GroupBox();
this.radOption3 = new System.Windows.Forms.RadioButton();
this.radOption2 = new System.Windows.Forms.RadioButton();
this.radRadioButton1 = new System.Windows.Forms.RadioButton();
this.lblListboxlabel = new System.Windows.Forms.Label();
this.lblCheckBox = new System.Windows.Forms.Label();
this.chkCheckIn = new System.Windows.Forms.CheckBox();
this.lblTextBox = new System.Windows.Forms.Label();
this.txttextbox = new System.Windows.Forms.TextBox();
this.cbocombobox = new System.Windows.Forms.ComboBox();
this.lblComboBox = new System.Windows.Forms.Label();
this.btnok = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.grGroupBox.SuspendLayout();
this.SuspendLayout();
//
// lstlistBox
//
this.lstlistBox.FormattingEnabled = true;
this.lstlistBox.Location = new System.Drawing.Point(59, 60);
this.lstlistBox.Name = "lstlistBox";
this.lstlistBox.Size = new System.Drawing.Size(120, 95);
this.lstlistBox.TabIndex = 0;
//
// lblGroupboxlabel
//
this.lblGroupboxlabel.AutoSize = true;
this.lblGroupboxlabel.Location = new System.Drawing.Point(255, 48);
this.lblGroupboxlabel.Name = "lblGroupboxlabel";
this.lblGroupboxlabel.Size = new System.Drawing.Size(167, 13);
this.lblGroupboxlabel.TabIndex = 1;
this.lblGroupboxlabel.Text = "GroupBox and RadioButtons label";
//
// grGroupBox
//
this.grGroupBox.Controls.Add(this.radOption3);
this.grGroupBox.Controls.Add(this.radOption2);
this.grGroupBox.Controls.Add(this.radRadioButton1);
this.grGroupBox.Location = new System.Drawing.Point(258, 65);
this.grGroupBox.Name = "grGroupBox";
this.grGroupBox.Size = new System.Drawing.Size(164, 100);
this.grGroupBox.TabIndex = 2;
this.grGroupBox.TabStop = false;
this.grGroupBox.Text = "Options";
//
// radOption3
//
this.radOption3.AutoSize = true;
this.radOption3.Location = new System.Drawing.Point(24, 68);
this.radOption3.Name = "radOption3";
this.radOption3.Size = new System.Drawing.Size(65, 17);
this.radOption3.TabIndex = 2;
this.radOption3.TabStop = true;
this.radOption3.Text = "Option 3";
this.radOption3.UseVisualStyleBackColor = true;
//
// radOption2
//
this.radOption2.AutoSize = true;
this.radOption2.Location = new System.Drawing.Point(24, 44);
this.radOption2.Name = "radOption2";
this.radOption2.Size = new System.Drawing.Size(65, 17);
this.radOption2.TabIndex = 1;
this.radOption2.TabStop = true;
this.radOption2.Text = "Option 2";
this.radOption2.UseVisualStyleBackColor = true;
//
// radRadioButton1
//
this.radRadioButton1.AutoSize = true;
this.radRadioButton1.Location = new System.Drawing.Point(24, 20);
this.radRadioButton1.Name = "radRadioButton1";
this.radRadioButton1.Size = new System.Drawing.Size(65, 17);
this.radRadioButton1.TabIndex = 0;
this.radRadioButton1.TabStop = true;
this.radRadioButton1.Text = "Option 1";
this.radRadioButton1.UseVisualStyleBackColor = true;
//
// lblListboxlabel
//
this.lblListboxlabel.AutoSize = true;
this.lblListboxlabel.Location = new System.Drawing.Point(59, 41);
this.lblListboxlabel.Name = "lblListboxlabel";
this.lblListboxlabel.Size = new System.Drawing.Size(66, 13);
this.lblListboxlabel.TabIndex = 3;
this.lblListboxlabel.Text = "ListBox label";
//
// lblCheckBox
//
this.lblCheckBox.AutoSize = true;
this.lblCheckBox.Location = new System.Drawing.Point(258, 197);
this.lblCheckBox.Name = "lblCheckBox";
this.lblCheckBox.Size = new System.Drawing.Size(88, 13);
this.lblCheckBox.TabIndex = 4;
this.lblCheckBox.Text = "Check Box Label";
//
// chkCheckIn
//
this.chkCheckIn.AutoSize = true;
this.chkCheckIn.Location = new System.Drawing.Point(258, 214);
this.chkCheckIn.Name = "chkCheckIn";
this.chkCheckIn.Size = new System.Drawing.Size(68, 17);
this.chkCheckIn.TabIndex = 5;
this.chkCheckIn.Text = "Check-in";
this.chkCheckIn.UseVisualStyleBackColor = true;
//
// lblTextBox
//
this.lblTextBox.AutoSize = true;
this.lblTextBox.Location = new System.Drawing.Point(59, 196);
this.lblTextBox.Name = "lblTextBox";
this.lblTextBox.Size = new System.Drawing.Size(78, 13);
this.lblTextBox.TabIndex = 6;
this.lblTextBox.Text = "Text Box Label";
//
// txttextbox
//
this.txttextbox.Location = new System.Drawing.Point(59, 214);
this.txttextbox.Name = "txttextbox";
this.txttextbox.Size = new System.Drawing.Size(100, 20);
this.txttextbox.TabIndex = 7;
//
// cbocombobox
//
this.cbocombobox.FormattingEnabled = true;
this.cbocombobox.Location = new System.Drawing.Point(171, 276);
this.cbocombobox.Name = "cbocombobox";
this.cbocombobox.Size = new System.Drawing.Size(121, 21);
this.cbocombobox.TabIndex = 8;
//
// lblComboBox
//
this.lblComboBox.AutoSize = true;
this.lblComboBox.Location = new System.Drawing.Point(171, 257);
this.lblComboBox.Name = "lblComboBox";
this.lblComboBox.Size = new System.Drawing.Size(87, 13);
this.lblComboBox.TabIndex = 9;
this.lblComboBox.Text = "ComboBox Label";
//
// btnok
//
this.btnok.Location = new System.Drawing.Point(110, 327);
this.btnok.Name = "btnok";
this.btnok.Size = new System.Drawing.Size(75, 23);
this.btnok.TabIndex = 10;
this.btnok.Text = "OK";
this.btnok.UseVisualStyleBackColor = true;
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(244, 327);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 11;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold);
this.label1.Location = new System.Drawing.Point(165, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(117, 20);
this.label1.TabIndex = 12;
this.label1.Text = "Header Label";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(456, 370);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnok);
this.Controls.Add(this.lblComboBox);
this.Controls.Add(this.cbocombobox);
this.Controls.Add(this.txttextbox);
this.Controls.Add(this.lblTextBox);
this.Controls.Add(this.chkCheckIn);
this.Controls.Add(this.lblCheckBox);
this.Controls.Add(this.lblListboxlabel);
this.Controls.Add(this.grGroupBox);
this.Controls.Add(this.lblGroupboxlabel);
this.Controls.Add(this.lstlistBox);
this.Name = "Form1";
this.Text = "Form1";
this.grGroupBox.ResumeLayout(false);
this.grGroupBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox lstlistBox;
private System.Windows.Forms.Label lblGroupboxlabel;
private System.Windows.Forms.GroupBox grGroupBox;
private System.Windows.Forms.RadioButton radOption3;
private System.Windows.Forms.RadioButton radOption2;
private System.Windows.Forms.RadioButton radRadioButton1;
private System.Windows.Forms.Label lblListboxlabel;
private System.Windows.Forms.Label lblCheckBox;
private System.Windows.Forms.CheckBox chkCheckIn;
private System.Windows.Forms.Label lblTextBox;
private System.Windows.Forms.TextBox txttextbox;
private System.Windows.Forms.ComboBox cbocombobox;
private System.Windows.Forms.Label lblComboBox;
private System.Windows.Forms.Button btnok;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label1;
}
}
RepeatMyName/Repeat01/Repeat01/Form1.resx

















































text/microsoft-resx


2.0


System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089


System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

RepeatMyName/Repeat01/Repeat01/obj/Debug/DesignTimeResolveAssemblyReferences.cache
RepeatMyName/Repeat01/Repeat01/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.csproj.FileListAbsolute.txt
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\bin\Debug\Repeat01.exe.config
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\bin\Debug\Repeat01.exe
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\bin\Debug\Repeat01.pdb
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\obj\Debug\Repeat01.csprojResolveAssemblyReference.cache
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\obj\Debug\Repeat01.Form1.resources
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\obj\Debug\Repeat01.Properties.Resources.resources
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\obj\Debug\Repeat01.csproj.GenerateResource.Cache
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\obj\Debug\Repeat01.exe
D:\greynodes-project\RepeatMyName\Repeat01\Repeat01\obj\Debug\Repeat01.pdb
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.csproj.GenerateResource.Cache
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.csprojResolveAssemblyReference.cache
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.exe
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.Form1.resources
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.pdb
RepeatMyName/Repeat01/Repeat01/obj/Debug/Repeat01.Properties.Resources.resources
RepeatMyName/Repeat01/Repeat01/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
RepeatMyName/Repeat01/Repeat01/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
RepeatMyName/Repeat01/Repeat01/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
RepeatMyName/Repeat01/Repeat01/Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Repeat01
{
static class Program
{
///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
RepeatMyName/Repeat01/Repeat01/Properties/AssemblyInfo.cs
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly:...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here