Problem #1: Your dev lead wants to plan a celebration for the 100th code war event that we have as a team. Since we onl

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Problem #1: Your dev lead wants to plan a celebration for the 100th code war event that we have as a team. Since we onl

Post by answerhappygod »

Problem #1:
Your dev lead wants to plan a celebration for the 100th code war event that we have as a team. Since we only do code wars on the 5th Friday of the month what date will the 100th event fall on?
Include 4/29/22 as the first event day.
Problem #2:
The problem is the same except we are only going to do code wars on the 5th Fridays that occur in February.
Use C #
Use this code to implement the solution:
using System;
using System.Diagnostics;
namespace September
{
/// <summary>
/// April Code War
/// </summary>
class Program
{
/// <summary>
/// Main method
/// </summary>
static void Main()
{
// Accuracy Test
Console.WriteLine(Calculate100thFifthFriday());
Console.WriteLine(Calculate100thFebruaryFifthFriday());
Console.Out.WriteLine();
Console.Out.WriteLine();
// Speed Test
Console.Out.WriteLine("Hit enter to start speed test");
Console.In.ReadLine();
Console.Out.WriteLine("Starting Speed Test");
Stopwatch sw = new Stopwatch();
sw.Start();
for (int i = 0; i < 100000; i++)
{
Calculate100thFifthFriday();
}
sw.Stop();
Console.Out.WriteLine("StopwatchTime:\t" + sw.ElapsedMilliseconds);
sw.Restart();
for (int i = 0; i < 100000; i++)
{
Calculate100thFebruaryFifthFriday();
}
sw.Stop();
Console.Out.WriteLine("StopwatchTime:\t" + sw.ElapsedMilliseconds);
Console.In.ReadLine();
}
// Change the signature of the following method as needed for your solution
/// <summary>
/// Finds candidate matches for a set of criteria
/// </summary>
/// <returns>Number of matching candidates for a set of criteria</returns>
public static string Calculate100thFifthFriday()
{
return "";
}
/// <summary>
/// Finds candidate matches for a set of criteria
/// </summary>
/// <returns>Number of matching candidates for a set of criteria</returns>
public static string Calculate100thFebruaryFifthFriday()
{
return "";
}
}
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply