Click here to Skip to main content
15,887,812 members
Home / Discussions / C#
   

C#

 
AnswerRe: Task Exception Handling Pin
Pete O'Hanlon14-Jul-15 23:24
mvePete O'Hanlon14-Jul-15 23:24 
SuggestionRe: Task Exception Handling Pin
Richard Deeming15-Jul-15 1:00
mveRichard Deeming15-Jul-15 1:00 
GeneralRe: Task Exception Handling Pin
Member 1183731415-Jul-15 8:52
Member 1183731415-Jul-15 8:52 
QuestionA New Task Scheduler Class Library for .NET Pin
jwc jwc14-Jul-15 9:54
jwc jwc14-Jul-15 9:54 
AnswerRe: A New Task Scheduler Class Library for .NET Pin
Richard Andrew x6414-Jul-15 10:00
professionalRichard Andrew x6414-Jul-15 10:00 
GeneralRe: A New Task Scheduler Class Library for .NET Pin
jwc jwc14-Jul-15 10:13
jwc jwc14-Jul-15 10:13 
AnswerRe: A New Task Scheduler Class Library for .NET Pin
Richard Andrew x6414-Jul-15 10:18
professionalRichard Andrew x6414-Jul-15 10:18 
QuestionC# Pin
Member 1183662614-Jul-15 4:12
Member 1183662614-Jul-15 4:12 
The exercise consists in creating a fully functional method/function to sort a set of squares one next to the other in increasing size order along the X axis.

The project has to be developed using C#, no other language is allowed. Try to make the method/function as professional as possible (proper comments, perfect indentation, meaningful variable names...) as it’s not a lab practical, it’s a professional development. Pay extreme attention to the details and the readability and simplicity of the code. Use auxiliary methods as required or deemed appropriate for a better structure and isolation and less coupling.

The method/function has to be developed in a file called metalcam_exercise.txt, add no other code than the required method/function in this file. The method name and parameters are as follows:
C#
public static void OrganiseSquares(ref List<Square> pio_Squares)

Method description:

The method OrganiseSquares gets a list of squares and modifies each square position so the squares are placed one next to the other in increasing size order along the X axis.

Parameter description:

pio_Squares: The list of squares as input and output. For the output the squares should be sorted from smaller to bigger and in the right position. All the squares are in position 0,0 initially.

return: The return value will be void as the imputed Square objects will be modified to set their position according to the algorithm.

The class Square is as follows:
C#
using System.Collections.Generic;

internal class Square
{
    private double m_Lenght;
    private double m_PositionX;
    private double m_PositionY;

    public Square(double p_Length)
    {
        m_Lenght = p_Length;
        m_PositionX = 0;
        m_PositionY = 0;        
    }

    public void SetPosition(double p_PositionX, double p_PositionY)
    {
        m_PositionX = p_PositionX;
        m_PositionY = p_PositionY;        
    }

    

    public double GetLenght()
    {

        return m_Lenght;

    }


   public static void OrganiseSquares(ref List<Square> pio_Squares)
   {
     // YOUR CODE HERE    
   }

}


modified 14-Jul-15 11:34am.

AnswerRe: C# Pin
OriginalGriff14-Jul-15 4:17
mveOriginalGriff14-Jul-15 4:17 
AnswerRe: C# Pin
Eddy Vluggen14-Jul-15 4:59
professionalEddy Vluggen14-Jul-15 4:59 
GeneralRe: C# Pin
OriginalGriff14-Jul-15 5:06
mveOriginalGriff14-Jul-15 5:06 
GeneralRe: C# Pin
Richard Deeming14-Jul-15 5:15
mveRichard Deeming14-Jul-15 5:15 
GeneralRe: C# Pin
OriginalGriff14-Jul-15 5:41
mveOriginalGriff14-Jul-15 5:41 
GeneralRe: C# Pin
Eddy Vluggen14-Jul-15 5:18
professionalEddy Vluggen14-Jul-15 5:18 
Questionvisual studio/creating a installer for programs Pin
jamesmc153514-Jul-15 2:27
jamesmc153514-Jul-15 2:27 
AnswerRe: visual studio/creating a installer for programs Pin
Wes Aday14-Jul-15 3:16
professionalWes Aday14-Jul-15 3:16 
GeneralRe: visual studio/creating a installer for programs Pin
jamesmc153514-Jul-15 3:21
jamesmc153514-Jul-15 3:21 
AnswerRe: visual studio/creating a installer for programs Pin
Ravi Bhavnani14-Jul-15 6:47
professionalRavi Bhavnani14-Jul-15 6:47 
Question[U8.1][XAML] Which's differently on isfullscreen and isfullwindows on media player framework? Pin
Lê Thiên Hoàng14-Jul-15 2:07
Lê Thiên Hoàng14-Jul-15 2:07 
QuestionNEW to c# Pin
jamesmc153514-Jul-15 1:11
jamesmc153514-Jul-15 1:11 
AnswerRe: NEW to c# Pin
OriginalGriff14-Jul-15 1:21
mveOriginalGriff14-Jul-15 1:21 
GeneralRe: NEW to c# Pin
jamesmc153514-Jul-15 1:27
jamesmc153514-Jul-15 1:27 
GeneralRe: NEW to c# Pin
Pete O'Hanlon14-Jul-15 1:38
mvePete O'Hanlon14-Jul-15 1:38 
GeneralRe: NEW to c# Pin
jamesmc153514-Jul-15 1:42
jamesmc153514-Jul-15 1:42 
GeneralRe: NEW to c# Pin
OriginalGriff14-Jul-15 1:42
mveOriginalGriff14-Jul-15 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.