Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Secure Coding Lab Zune Failure Part 1 Purpose: Explore the Zune Failure from December 2008. Tools: Students can use any tool of their choice Assignment:

Secure Coding Lab

Zune Failure Part 1

Purpose: Explore the Zune Failure from December 2008.

Tools: Students can use any tool of their choice

Assignment: Students will do individual work. The deliverable is an explanation of the code that resulted in the Microsoft Zune failure of December 31, 2008. Code is attached.

Deliverable: Analyzing the code, explain why it failed, show the specific lines of code with an explanation of why. And how to fix it.

Due Date: Beginning of class 1 week after assignment

Code:

#define ORIGINYEAR 1980

BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)

{

int dayofweek, month, year;

UINT8 *month_tab;

//Calculate current day of the week

dayofweek = GetDayOfWeek(days);

year = ORIGINYEAR;

while (days > 365)

{

if (IsLeapYear(year))

{

if (days > 366)

{

days -= 366;

year += 1;

}

}

else

{

days -= 365;

year += 1;

}

}

// Determine whether it is a leap year

month_tab = (UINT8 *)((IsLeapYear(year))? monthtable_leap : monthtable);

for (month=0; month<12; month++)

{

if (days <= month_tab[month])

break;

days -= month_tab[month];

}

month += 1;

lpTime->wDay = days;

lpTime->wDayOfWeek = dayofweek;

lpTime->wMonth = month;

lpTime->wYear = year;

return TRUE;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

=+j Enabling a productive global workforce.

Answered: 1 week ago