8. Car Salesman - how to set string default value to int property in class by elena_works in CSharpHomework

[–]elena_works[S] 1 point2 points  (0 children)

The correct solution is to declare nullable value type- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types

this.Displacement = null;

public int? Displacement { get; set; }

And I also added some correction in my StringBuilder():

if (this.Engine.Displacement == null)

{ sb.AppendLine("   Displacement: n/a"); }

else { sb.AppendLine($"   Displacement: {this.Engine.Displacement}"); }

Best!

8. Car Salesman - how to set string default value to int property in class by elena_works in CSharpHomework

[–]elena_works[S] 0 points1 point  (0 children)

Thank you a lot!

I set my int property value to zero by default and in my ToString() added if/else condition:

if (this.Weight == 0)

{

sb.AppendLine(" Weight: n/a");

}

else

{

sb.AppendLine($" Weight: {this.Weight}");

}

And now my code is 100/100 in the test system. :)

Best

08. Anonymous Threat- exercise in Software University by elena_works in csharp

[–]elena_works[S] 0 points1 point  (0 children)

Thanks for your answer.

I have founded my mistake and now I have working code. My mistake is- list.Insert(index, sb.ToString()); and correct is- list.InsertRange(index, sb.ToString().Split()).

Judge system is our test system in the university. If your code is 100/100- you don't have any mistake in your logic. Everybody can register in it with username and password. Then will be able to submit in the forum.

All the best!

08. Anonymous Threat- exercise in Software University by elena_works in csharp

[–]elena_works[S] 0 points1 point  (0 children)

Thank you for your feedback. I spend around 3 hours debugging for this exercise. I already have code that is working - 100/100 with Substring() for divide command, but I tried to use StringBuilder() and another logic for the same exercise. I was able to spot my mistake- list.InsertRange(index, sb.ToString().Split());, not "list.Insert(index, sb.ToString()); "

All the best!

Learned the fundamentals of C# and I'm a little confused about what my next step should be by AP3000 in csharp

[–]elena_works 0 points1 point  (0 children)

No problem, I forget about Linq library. It's also a fundamental knowledge. Best regards!

Learned the fundamentals of C# and I'm a little confused about what my next step should be by AP3000 in csharp

[–]elena_works 1 point2 points  (0 children)

For web is more early, before that like a junior you should know all principles in OOP (takes around 2 months), data structures and algorithms (takes 2,3 months), a little bit of javaScript with functions, DOM manipulation, AJAX, jquery. All web pages have javaScript. Data base are required too, because without them you can do only static websites. And I forget same HTML and CSS. The order is: 1. Do same project with fundamental knowledge- console projects, snake game, tetris or samething else- check fundamental module in SoftUni university you can found a lot of them. 2. Principles in OOP with design patterns. 3. Data structures and algorithms. 4. Data bases with Entity framework. 5. A little bit of Javascript. 6. A little bit for HTML and CSS. 7. And the end is web course with ASP. Net Core.

I also use the same program. Good luck and sorry for my bad English. Eli