Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialds1
7,627 Points560.88?
When testing my code, I receive 560.88 at the top of the output. However, my code passes the challenge. Bug?
using System;
class Program
{
// YOUR CODE HERE: Define a method named Multiply. Remember
// to use the "static" and "void" keywords: "static void
// Multiply" (without quotes). Multiply should take two
// "double" values as parameters.
static void Multiply(double num1, double num2)
{
Console.WriteLine(num1*num2);
}
static void Main(string[] args)
{
// YOUR CODE HERE:
// Call Multiply with two arguments: 2.5 and 2.
// YOUR CODE HERE:
// Call Multiply with two arguments: 6 and 7.
Multiply(2.5, 2);
Multiply(6, 7);
}
}
2 Answers
Ariel Rzeszowski
5,482 PointsVery strange things xD
Somehow program call method it self.
static void Multiply(double num1, double num2)
{
Console.WriteLine(num1);
Console.WriteLine(num2);
}
static void Main(string[] args)
{
}
When you run this, you get a result : 12.3 45.6
You must to ask a support to help. I don't know why it works like that.
ds1
7,627 PointsThanks, Ariel!
Myers Carpenter
6,421 PointsMyers Carpenter
6,421 PointsYou are right. The teacher's code for the challenge finds out if you have followed the directions and looks at your code to see if you have defined a Multiply method and calls it with parameters you didn't specify in your code to make sure you didn't just hard code the answers in.