Question Details

(solution) This is a C# code I wrote inside of Microsoft Visual Studio. I


This is a C# code I wrote inside of Microsoft Visual Studio. I need someone to check over my work and explain why my calculations always return 0 instead of doing the proper methods that I wrote. Please highlight and fix the errors.




Demo.aspx.cs:


using Assignment5.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Assignment5
{
public partial class Demo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void factorial_Click(object sender, EventArgs e)
{
Operations ans = new Operations();

int userInput = Convert.ToInt32(inputTxt.Text);

result.Text = ans.Factorial().ToString();
}




protected void sum_Click(object sender, EventArgs e)
{
Operations anstwo = new Operations();

int userInput = Convert.ToInt32(inputTxt.Text);

result.Text = anstwo.Sum().ToString();
}
}
}







(Models page) Operations.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Assignment5.Models
{
public class Operations
{
private int userInput;
public int UserInput

{
get
{
return this.userInput;
}
set
{
this.userInput = value;
}
}






public int Factorial()

{

int fac = userInput;
for (int i = 1; i {
fac = fac * i;

}

return fac;
}






public int Sum()

{

int sum = userInput;
for (int i = 1; i {
sum = sum + i;
}

return sum;




}

}
}


































































































 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Jan 30, 2021

PRICE: $15

Solution~0001000596.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free solution (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Jan 30, 2021

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now