SlideShare a Scribd company logo
1 of 3
Download to read offline
CODE THIS IN C# AND USE VISUAL STUDIO
Additional logic required by the Fraction Class
1. Another constructor that takes string arguments instead of ints.
2. Add two methods that will overload the * and / arithmetic operators.
Functionalities/Features required by the Application.
Design:
Your form must look and feel like normal application. Buttons are meant to be clicked, and
Label
are not meant to be clicked. Textboxes should take user inputs. Do not make controls appear or
disappear. Do not change the color or size of text unless you have a compelling reason to do so.
Naming:
1. All controls accessed in your code must have names with well-known prefixes.
Method:
private void DoCalculation() - this method does the actual calculation. The logic in contained in
a
method so that it can be invoked from different parts of the application.
It performs the appropriate computation based on the value of the string variable
operation.
And assigns the resulting value to the appropriate textboxes.
EventHandlers:
1. To handle the Click event of the button:
This will invoke the DoCalculation() method above.
2. To handle the KeyPress event for all the textboxes:
This will prevent non-digit entry to the required
textboxes. Copy and paste the following statements
into the handler.
if (char.IsDigit(e.KeyChar))
return;
else
e.Handled = true; //discard the non-digit entries
This will filter the input to the textboxes so that only digits are accepted.
3. To handle the CheckChanged event for all the radio buttons:
The text of the radio button is assigned to the string
variable operation. To do this, you will use the
first argument (sender) and cast to a
RadioButton, now you will be able to get the text
of the control.
Then invoke the DoCalculation() method above.
Behavior:
You must be able to use this application with or without a pointing device. i.e. You must be able
to
use with keyboard only.
The tab key is used to jump from one control to another. The space-bar toggles properties. Such
as a Checkbox or a RadioButton. If you dont want a control get focus via the tab key, then set
the
TabStop property on the control to false.
Specify the tab order:
Set the TabIndex property for all the interactable components so that the user can use the
application without the support of a mouse. The first control to have focus must have its
TabIndex property set to 0 and the next o 1 and so on...
Fraction Class:
Additionally, you will need to add code to overload the times and divide operator. It is good
practice to define classes in separate files.
/**
* Fraction class supplies the underlying logic to
* drive this application. A better design might be
* to have this in a separate file or as a library.
*/
public class Fraction
{
public int Top { get; }
public int Bottom { get; }
/**
* This constructor takes two optional int
* arguments and assigns them to the
* appropriate properties
*/
public Fraction(int top = 0, int bottom = 1)
=> (Top, Bottom) = (top, bottom);
/**
* Add another constructor that takes two optional string
* arguments and assigns them to the appropriate
* properties (of course after conversion).
*/
public static Fraction operator +(Fraction lhs, Fraction rhs)
=> new Fraction(lhs.Top * rhs.Bottom + rhs.Top * lhs.Bottom, lhs.Bottom * rhs.Bottom);
public static Fraction operator -(Fraction lhs, Fraction rhs)
=> new Fraction(lhs.Top * rhs.Bottom - rhs.Top * lhs.Bottom, lhs.Bottom * rhs.Bottom);
/**
* Add two more methods that overloads the arithmetic
* operators multiply and divide arithmetic.
*/
public override string ToString()
=> $"[{Top}, {Bottom}]";
/**
* This Deconstructor allows you to get both properties
* with a single statement.
*/
public void Deconstruct(out string top, out string bottom)
=> (top, bottom) = ($"{Top}", $"{Bottom}");
} RadioButton (placed in a container)

More Related Content

Similar to CODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdf

Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
dhi her
 
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
import java.util.Scanner;Henry Cutler ID 1234  7202.docximport java.util.Scanner;Henry Cutler ID 1234  7202.docx
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
wilcockiris
 
Assignment Examples Final 07 Oct
Assignment Examples Final 07 OctAssignment Examples Final 07 Oct
Assignment Examples Final 07 Oct
Sriram Raj
 
I am trying to fill out a program where the method definitions will b.docx
I am trying  to fill out a program where the method definitions will b.docxI am trying  to fill out a program where the method definitions will b.docx
I am trying to fill out a program where the method definitions will b.docx
Phil4IDBrownh
 
Program Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdfProgram Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdf
alsofshionchennai
 
CS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2ndCS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2nd
Edward Chen
 
Please assist with this and use single line comment to explain each .pdf
Please assist with this and use single line comment to explain each .pdfPlease assist with this and use single line comment to explain each .pdf
Please assist with this and use single line comment to explain each .pdf
agarshailenterprises
 
Create a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfCreate a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdf
devangmittal4
 

Similar to CODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdf (20)

1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
import java.util.Scanner;Henry Cutler ID 1234  7202.docximport java.util.Scanner;Henry Cutler ID 1234  7202.docx
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
 
Assignment Examples Final 07 Oct
Assignment Examples Final 07 OctAssignment Examples Final 07 Oct
Assignment Examples Final 07 Oct
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Unit iii vb_study_materials
Unit iii vb_study_materialsUnit iii vb_study_materials
Unit iii vb_study_materials
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
 
I am trying to fill out a program where the method definitions will b.docx
I am trying  to fill out a program where the method definitions will b.docxI am trying  to fill out a program where the method definitions will b.docx
I am trying to fill out a program where the method definitions will b.docx
 
Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++
 
Maxbox starter19
Maxbox starter19Maxbox starter19
Maxbox starter19
 
Amit user defined functions xi (2)
Amit  user defined functions xi (2)Amit  user defined functions xi (2)
Amit user defined functions xi (2)
 
Program Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdfProgram Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdf
 
CS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2ndCS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2nd
 
Please assist with this and use single line comment to explain each .pdf
Please assist with this and use single line comment to explain each .pdfPlease assist with this and use single line comment to explain each .pdf
Please assist with this and use single line comment to explain each .pdf
 
Create a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfCreate a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdf
 
Maxbox starter
Maxbox starterMaxbox starter
Maxbox starter
 
Microsoft dynamics ax 2012 development introduction part 2/3
Microsoft dynamics ax 2012 development introduction part 2/3Microsoft dynamics ax 2012 development introduction part 2/3
Microsoft dynamics ax 2012 development introduction part 2/3
 

More from secunderbadtirumalgi

Como parte de su programa Global Health Partnerships (2008-2011), Pf.pdf
Como parte de su programa Global Health Partnerships (2008-2011), Pf.pdfComo parte de su programa Global Health Partnerships (2008-2011), Pf.pdf
Como parte de su programa Global Health Partnerships (2008-2011), Pf.pdf
secunderbadtirumalgi
 
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdfComo alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
secunderbadtirumalgi
 
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP  #inc.pdfCODE FOR echo_client.c A simple echo client using TCP  #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
secunderbadtirumalgi
 

More from secunderbadtirumalgi (20)

Code using Java Programming and use JavaFX. Show your code and outpu.pdf
Code using Java Programming and use JavaFX. Show your code and outpu.pdfCode using Java Programming and use JavaFX. Show your code and outpu.pdf
Code using Java Programming and use JavaFX. Show your code and outpu.pdf
 
Como parte de su programa Global Health Partnerships (2008-2011), Pf.pdf
Como parte de su programa Global Health Partnerships (2008-2011), Pf.pdfComo parte de su programa Global Health Partnerships (2008-2011), Pf.pdf
Como parte de su programa Global Health Partnerships (2008-2011), Pf.pdf
 
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdf
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdfComo parte de la investigaci�n de su tesis, genera una biblioteca de.pdf
Como parte de la investigaci�n de su tesis, genera una biblioteca de.pdf
 
Como administrador de la colecci�n de espec�menes en un museo de his.pdf
Como administrador de la colecci�n de espec�menes en un museo de his.pdfComo administrador de la colecci�n de espec�menes en un museo de his.pdf
Como administrador de la colecci�n de espec�menes en un museo de his.pdf
 
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdfComo alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
Como alcalde de Tropical Island, se enfrenta al doble mandato de pre.pdf
 
Commentators on the US economy feel the US economy fell into a reces.pdf
Commentators on the US economy feel the US economy fell into a reces.pdfCommentators on the US economy feel the US economy fell into a reces.pdf
Commentators on the US economy feel the US economy fell into a reces.pdf
 
Combe Corporation has two divisions Alpha and Beta. Data from the m.pdf
Combe Corporation has two divisions Alpha and Beta. Data from the m.pdfCombe Corporation has two divisions Alpha and Beta. Data from the m.pdf
Combe Corporation has two divisions Alpha and Beta. Data from the m.pdf
 
Coloque los eventos para explicar c�mo un bien p�blico llega a ser d.pdf
Coloque los eventos para explicar c�mo un bien p�blico llega a ser d.pdfColoque los eventos para explicar c�mo un bien p�blico llega a ser d.pdf
Coloque los eventos para explicar c�mo un bien p�blico llega a ser d.pdf
 
College students often make up a substantial portion of the populati.pdf
College students often make up a substantial portion of the populati.pdfCollege students often make up a substantial portion of the populati.pdf
College students often make up a substantial portion of the populati.pdf
 
Code using Java Programming. Show your code and output.Create a pe.pdf
Code using Java Programming. Show your code and output.Create a pe.pdfCode using Java Programming. Show your code and output.Create a pe.pdf
Code using Java Programming. Show your code and output.Create a pe.pdf
 
code in html with div styles 9. Town of 0z Info - Microsoft Interne.pdf
code in html with div styles  9. Town of 0z Info - Microsoft Interne.pdfcode in html with div styles  9. Town of 0z Info - Microsoft Interne.pdf
code in html with div styles 9. Town of 0z Info - Microsoft Interne.pdf
 
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP  #inc.pdfCODE FOR echo_client.c A simple echo client using TCP  #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
 
Coastal Louisiana has been experiencing habitat fragmentation and ha.pdf
Coastal Louisiana has been experiencing habitat fragmentation and ha.pdfCoastal Louisiana has been experiencing habitat fragmentation and ha.pdf
Coastal Louisiana has been experiencing habitat fragmentation and ha.pdf
 
Cloud Solutions had the following accounts and balances as of Decemb.pdf
Cloud Solutions had the following accounts and balances as of Decemb.pdfCloud Solutions had the following accounts and balances as of Decemb.pdf
Cloud Solutions had the following accounts and balances as of Decemb.pdf
 
Climate scientists claim that CO2 has risen recently to levels that .pdf
Climate scientists claim that CO2 has risen recently to levels that .pdfClimate scientists claim that CO2 has risen recently to levels that .pdf
Climate scientists claim that CO2 has risen recently to levels that .pdf
 
Climate change is one of the defining challenges of our time, but to.pdf
Climate change is one of the defining challenges of our time, but to.pdfClimate change is one of the defining challenges of our time, but to.pdf
Climate change is one of the defining challenges of our time, but to.pdf
 
Classify each of the following items as excludable, nonexcludable, r.pdf
Classify each of the following items as excludable, nonexcludable, r.pdfClassify each of the following items as excludable, nonexcludable, r.pdf
Classify each of the following items as excludable, nonexcludable, r.pdf
 
Chris is a young moonshine producer in the Tennessee region of Appal.pdf
Chris is a young moonshine producer in the Tennessee region of Appal.pdfChris is a young moonshine producer in the Tennessee region of Appal.pdf
Chris is a young moonshine producer in the Tennessee region of Appal.pdf
 
choose the right answer onlyQuestion 9 What are the four facto.pdf
choose the right answer onlyQuestion 9 What are the four facto.pdfchoose the right answer onlyQuestion 9 What are the four facto.pdf
choose the right answer onlyQuestion 9 What are the four facto.pdf
 
Choose ONE of the scenarios below and write a problem-solving report.pdf
Choose ONE of the scenarios below and write a problem-solving report.pdfChoose ONE of the scenarios below and write a problem-solving report.pdf
Choose ONE of the scenarios below and write a problem-solving report.pdf
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 

CODE THIS IN C# AND USE VISUAL STUDIOAdditional logic required by .pdf

  • 1. CODE THIS IN C# AND USE VISUAL STUDIO Additional logic required by the Fraction Class 1. Another constructor that takes string arguments instead of ints. 2. Add two methods that will overload the * and / arithmetic operators. Functionalities/Features required by the Application. Design: Your form must look and feel like normal application. Buttons are meant to be clicked, and Label are not meant to be clicked. Textboxes should take user inputs. Do not make controls appear or disappear. Do not change the color or size of text unless you have a compelling reason to do so. Naming: 1. All controls accessed in your code must have names with well-known prefixes. Method: private void DoCalculation() - this method does the actual calculation. The logic in contained in a method so that it can be invoked from different parts of the application. It performs the appropriate computation based on the value of the string variable operation. And assigns the resulting value to the appropriate textboxes. EventHandlers: 1. To handle the Click event of the button: This will invoke the DoCalculation() method above. 2. To handle the KeyPress event for all the textboxes: This will prevent non-digit entry to the required textboxes. Copy and paste the following statements into the handler. if (char.IsDigit(e.KeyChar)) return; else e.Handled = true; //discard the non-digit entries This will filter the input to the textboxes so that only digits are accepted. 3. To handle the CheckChanged event for all the radio buttons: The text of the radio button is assigned to the string
  • 2. variable operation. To do this, you will use the first argument (sender) and cast to a RadioButton, now you will be able to get the text of the control. Then invoke the DoCalculation() method above. Behavior: You must be able to use this application with or without a pointing device. i.e. You must be able to use with keyboard only. The tab key is used to jump from one control to another. The space-bar toggles properties. Such as a Checkbox or a RadioButton. If you dont want a control get focus via the tab key, then set the TabStop property on the control to false. Specify the tab order: Set the TabIndex property for all the interactable components so that the user can use the application without the support of a mouse. The first control to have focus must have its TabIndex property set to 0 and the next o 1 and so on... Fraction Class: Additionally, you will need to add code to overload the times and divide operator. It is good practice to define classes in separate files. /** * Fraction class supplies the underlying logic to * drive this application. A better design might be * to have this in a separate file or as a library. */ public class Fraction { public int Top { get; } public int Bottom { get; } /** * This constructor takes two optional int * arguments and assigns them to the * appropriate properties */ public Fraction(int top = 0, int bottom = 1)
  • 3. => (Top, Bottom) = (top, bottom); /** * Add another constructor that takes two optional string * arguments and assigns them to the appropriate * properties (of course after conversion). */ public static Fraction operator +(Fraction lhs, Fraction rhs) => new Fraction(lhs.Top * rhs.Bottom + rhs.Top * lhs.Bottom, lhs.Bottom * rhs.Bottom); public static Fraction operator -(Fraction lhs, Fraction rhs) => new Fraction(lhs.Top * rhs.Bottom - rhs.Top * lhs.Bottom, lhs.Bottom * rhs.Bottom); /** * Add two more methods that overloads the arithmetic * operators multiply and divide arithmetic. */ public override string ToString() => $"[{Top}, {Bottom}]"; /** * This Deconstructor allows you to get both properties * with a single statement. */ public void Deconstruct(out string top, out string bottom) => (top, bottom) = ($"{Top}", $"{Bottom}"); } RadioButton (placed in a container)