TweetFollow Us on Twitter

The Road to Code: Pointing the Way

Volume Number: 23 (2007)
Issue Number: 08
Column Tag: The Road to Code

The Road to Code: Pointing the Way

Game on!

by Dave Dribin

Welcome Back

Welcome back to The Road to Code. By now, you should be an expert at using simple variables, functions, and mathematical expressions. Even if you're not, you're probably itching to do something more interesting. Well you're in luck. This month we are going to be building a simple game. First, we'll go over three features of the C language: loops, conditional statements, and pointers. We'll look at them individually, and then we'll combine them to build something more complex.

Can You Repeat that, Please?

Sometimes you want to repeat a section of code multiple times. For example, if we wanted to print the numbers from one to five, we could write a simple C program, like this:

Listing 1: main.c Counting to five

#include <stdio.h>
int main(int argc, const char * argv[])
{
   printf("1\n");
   printf("2\n");
   printf("3\n");
   printf("4\n");
   printf("5\n");
   return 0;
}

As an alternative, instead of hard coding the number inside the string, we could use a variable to hold the current number:

Listing 2: main.c Counting with a variable

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   
   number = 1;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   
   return 0;
}

Given the discussion of variables last month, this code should look familiar. However, I did throw one curve ball. I'm using number++, which is just fancy shorthand for number = number + 1. The benefit of using a variable is that if you needed to change your code to count to ten, you could just copy and paste these two lines of code five more times:

   number++;
   printf("%d\n", number);

Although repeating code like this is more flexible than the hard coded strings in Listing 1, it's not without its drawbacks. Copying and pasting is prone to error. You could accidentally paste those two lines six more times, instead of five. You would now have a bug in your program, as it would print until eleven, instead of ten. Luckily, the C language has a solution to help avoid code repetition, called loops.

While Loops

Repeating the same code multiple times is called looping because after executing a block of code, you want it to loop back around to the beginning, as if the computer was running laps around a track. There are a few of different kinds of loops in C, but the first one we'll be looking at is called a while loop. A while loop repeats the same block of code, while a condition remains valid. Here is how we could rewrite our counting program to use a while loop:

Listing 3: main.c Counting with a while loop

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   
   number = 1;
   while (number <= 5)
   {
      printf("%d\n", number);
      number = number + 1;
   }
   return 0;
}

All while loops have this same basic structure:

   while (condition)
   {
      body
   }

First, you have the keyword while. Next is the condition, in parenthesis. And finally, the body of the loop, enclosed in braces. The body of a loop is very similar to a body of a function: it's a collection of statements that get executed in order. The body of a while loop is executed over and over, so long as the condition of the while loop remains true. Each time through the loop is called an iteration, thus the while loop iterates over the body.

Conditions

The condition, also called a conditional expression, is similar to the mathematic expressions described last month, except that instead of having the computer perform arithmetic, they are a way to ask the computer simple questions. In this case, the <= symbol is called a less than or equal to operator. Thus the expression "number <= 5" is asking the computer "is the variable 'number' less than or equal to five?" The computer responds to this question with a "Yes" or "No" answer. Because the answer is a simple Yes/No value, it is called a Boolean value. Sometimes the "Yes" and "No" values are called "True" and "False," respectively, which is why a Boolean value is also known as a truth value.

That's enough of the fancy computer science terminology for now. What's important is that a while loop keeps executing its body so long as the condition returns true. And in this case, it keeps executing the body so long as the number variable is less than or equal to five. It is important that our body keeps adding one to number. If it didn't, our while condition would always be true, and it would keep printing the same number over and over, forever. When a loop condition is always true, this special case is called an infinite loop. Infinite loops are usually bugs and can cause the program to stop responding normally. When writing your own loops, double-check your code to ensure you are avoiding an infinite loop. As a side bit of trivia, the street address for Apple's headquarters in Cupertino, California is "1 Infinite Loop". Ah... humor only a geek could love.

Using the while loop, if we want to change the program to count to ten, we just have to change the condition at the top of our while loop to:

   while (number <= 10)

That is much less repetition. No more copying and pasting, and we can now count to 100 or even 1,000 very easily. Counting that high would require a lot more work using Listing 1 or Listing 2 as a starting point. As you gain more experience, I think you will notice that reducing repetition is a key to designing programs with fewer bugs.

To finish off the topic of conditions, I'll provide you with a list of a few common conditional operations. You may use the conditional operators found in Table 1 in a similar manner to how we used <= above.

Table 1: Simple Conditional Operators

Operation   C Syntax   
Equals   ==   
Not Equals   !=   
Less Than   <   
Greater Than   >   
Less Than or Equals   <=   
Greater Than or Equals   >=   

For Loops

Another kind of loop is a for loop. Using a for loop, we can rewrite our counting while loop as:

Listing 4: main.c Counting with a for loop

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   
   for (number = 1; number <= 5; number++)
   {
      printf("%d\n", number);
   }
   
   return 0;
}

This simplifies our while loop by putting the initial value, the check, and the increment all on one line. All for loops have this same basic structure:

   for (initial expression; condition; loop expression)
   {
      body
   }

The initial expression -- in this case, "number = 1" -- is executed before the loop starts. The body of the loop is executed as long as the condition remains true. Finally, the loop expression is executed at the end of every loop iteration. In fact, any for loop can be rewritten as a while loop:

   initial expression
   while (condition)
   {
      body
      loop expression
   }

Because these are equivalent, you should choose a for loop or a while loop based on what makes your code easiest to read and understand. Oh, one final tidbit: when the body of a loop is only a single statement, you can leave off the braces:

int main(int argc, const char * argv[])
{
   int number;
   
   for (number = 1; number <= 5; number++)
      printf("%d\n", number);
   
   return 0;
}

Be careful, though. If you add a second statement, be sure to add those braces back!

Do While Loops

The final loop construct provided by C is called a do/while loop. This is very similar to a while loop, except the body of the loop is always executed at least once. A do/while loop takes the form of:

   do
   {
      body
   }
   while (condition);

The loop now begins with the do keyword, and the condition is moved to the bottom, after the braces. This ensures that the body is executed at least once, because the condition isn't tested until after one iteration of the body. We will be using this in our game program.

Bugs

I've already used the word "bug" a few times in this article, and I'm sure you've heard it before. But what exactly is a bug? The simplest definition is: an error in the program that causes it to not run as intended. "Run as intended" is a rather vague statement, though. Whose intention are we talking about? Take my first example of a bug where I modified the program that counts to five and changed it to count to ten. If I cut and pasted that code one too many times, and it counted to eleven instead, this could be considered a bug. My intention was to write a program that counts to ten, but it counts to eleven! Of course the intention may depend on your end user. If you were Nigel Tufnel of Spinal Tap, going to eleven would be the correct behavior.

There are many, many reasons why programs have bugs. It all boils down to the fact that software is written by humans, and humans make mistakes. There's no way around it. Programs you write will have bugs too. As your programs get larger, the more bugs you will write. If you're going to keep your sanity while writing programs, you're going to have to come to terms with the existence of bugs.

The process of finding and removing bugs is called debugging. Debugging is a large topic in itself, so I won't be talking about it extensively right now.

Making Decisions

Conditional expressions have another important use. You may want to execute a block of code only if a certain condition is true. For example, let's write a program to print every age from one to thirty and whether or not someone that age may vote in the United States:

Listing 5: main.c Printing voting age

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   
   for (age = 1; age <= 30; age++)
   {
      if (age < 18)
         printf("You may not vote at age %d\n", age);
      else
         printf("You may vote at age %d\n", age);
   }
   
   return 0;
}

Here we are using a for loop to iterate over all ages between one and thirty. Inside the body of the loop, we are using a new construct called an if statement to check the age. Just like a while loop condition, an if statement contains a condition and a body. The body only gets executed when the condition is true. The else statement contains a block that only gets executed when the condition is false. The else statement is optional. If you don't need it, just leave it off. You may also add another if statement onto an else statement:

   if (age < 18)
      printf("You do not have to pay taxes\n");
   else if (age >= 65)
      printf("You may collect social security\n");
   else
      printf("You must pay taxes\n");

And that wraps up loops and conditional statements. Try writing your own program that combines these concepts. For example, try writing a program that prints whether or not someone with a particular age is eligible to drive where you live.

Pointers

Pointers are one of the most important concepts of C, and they are used quite heavily in Objective-C. They are also considered one of the most difficult concepts in C. We'll take it step by step, and in time, I'm sure you'll be able to grasp pointers, as well.

Last month, I used storage boxes as an analogy for variables. For a quick refresher, a variable is like a storage box in that it holds different types of data, such as integer numbers and floating point numbers. However, that analogy goes further. A computer program will have lots of variables, and sometimes a variable with the same name will be used in different functions. How does the computer keep track? Just like the post office uses numbers to keep track of P.O. boxes, the computer uses numbers to keep track of all the variables. It gives each variable a unique number. In fact, this number is also called an address. [Ed. note: for the system administrators in the audience, you can think of this like DNS. People like names, so, we invent a name like www.apple.com. However, computers like numbers, so, we need a way to get the address for www.apple.com, which nslookup and dig will do. You can translate back and forth between name and address.]

The C compiler hides the details of variable addresses because it's easier for people to remember variable names rather than addresses. The compiler provides a way to get the address of a variable, using the address of operator, which is an ampersand character (&). Here is a small program to print out the address of a variable:

Listing 6: main.c Printing an address

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   number = 5;
   printf("The contents of number: %d\n", number);
   printf("The address of number: %u\n", &number);
   
   return 0;

}

You should get output similar to this in the Run Log window:

The contents of number: 5
The address of number: 3221223788

Your address may be different, but what's important is that every variable has a unique address. Remember from last time that %d in printf formats an integer, which may be positive or negative. %u tells printf that the number is an unsigned, positive only, integer. [1]

You can also declare a variable that holds an address. Our code above could be rewritten as:

Listing 7: main.c Using a pointer

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   int * pointer;
   number = 5;
   pointer = &number;
   printf("The contents of number: %d\n", number);
   printf("The address of number: %u\n", pointer);
   printf("The address of pointer: %u\n", &pointer);
   
   return 0;
}

If you run this, again you should get output similar to this:

The contents of number: 5
The address of number: 3221223788
The address of pointer: 3221223784

You'll notice that the pointer variable has an asterisk, or star, in front if it. This changes the type of pointer from an "integer" to a "pointer to an integer", which means it holds an address, instead of an actual integer. There are a couple of interesting points about the output. First, the address of number is still the same. Second, the address of pointer is different. Remember, even though pointer holds an address, it, too, is a variable and gets its own address. Thus our program has two variables, or P.O. boxes, which are summarized in Figure 1. Remember, these addresses may be different on your computer, and are essentially arbitrary.


Figure 1: Variables as boxes

Dereferencing Pointers

That said, you rarely print out an address. Pointers are usually used to modify the contents of another variable. For example:

Listing 8: main.c Dereferencing a pointer

#include <stdio.h> int main(int argc, const char * argv[]) { int number; int * pointer; number = 5; pointer = &number; printf("The contents of number: %d\n", number); *pointer = 10; printf("The contents of number: %d\n", number); return 0; }

This will produce output like:

The contents of number: 5
The contents of number: 10

Whoa! What happened there? The contents of the number variable changed, as if we had written:

   number = 10;

Using the star before pointer tells the compiler that we want to change what is at the address of pointer. Let's examine more closely what happens when we use a line of code like "number = 10". The compiler says, "Hmm... I know the number variable has a box with address 3221223788. Let me change the contents of the box at address 3221223788 to 10."

Putting a star in front of pointer is exactly the same thing. Remember that even though pointer has its own address, the contents of pointer is the same address as number: 3221223788. When the compiler sees "*pointer = 10" it says, "The contents of pointer contains the address 3221223788. Let me change the contents of box at address 3221223788 to 10." Using star before a pointer like this is called dereferencing a pointer. Also the star, when used to dereference a pointer, is called the contents of operator.

You can see, now, how pointers get their name. Pointers point to another variable. In this case, the variable pointer points to the variable number. If you're still confused, think of pointers like file aliases on your desktop. When you create an alias in the Finder, the alias points to the original file. If you open the alias, and make changes to it, the original file gets updated, as well. In the same fashion, pointers allow you to alter the contents of another variable.

Passing Pointers to Functions

Is your head spinning, yet? I hope not. Let's run through another scenario where using pointers are helpful. Let's write a function that triples any number that gets passed into it:

Listing 9: main.c Incorrect triple function

#include <stdio.h>
void triple(int n)
{
   n = n * 3;
}
int main(int argc, const char * argv[])
{
   int number;
   number = 5;
   printf("The contents of number: %d\n", number);
   
   triple(number);
   printf("The contents of number: %d\n", number);
   
   return 0;
}

Even though this code may look correct, it actually has a bug in it. If you run it, you will get this output:

The contents of number: 5
The contents of number: 5

Eh? Why is number still 5, you may be asking? It turns out that arguments of functions are also variables. Thus, the argument n of triple has its own address. Calling the triple function copies the contents of number into the contents of n. When triple changes n, it has no effect on number. We can verify this by printing the variable in triple:

void triple(int n)
{
   n = n * 3;
   printf("n in triple: %d\n", n);
}

This produces the output:

The contents of number: 5
n in triple: 15
The contents of number: 5

Okay, well how do fix this? Pointers to the rescue!

Listing 10: main.c Correct triple function with pointers

#include <stdio.h> void triple(int * pointer) { int n = *pointer; n = n * 3; *pointer = n; } int main(int argc, const char * argv[]) { int number; number = 5; printf("The contents of number: %d\n", number); triple(&number); printf("The contents of number: %d\n", number); return 0; }

This time, you should get the correct output:

The contents of number: 5
The contents of number: 15

So what changed here? First, we are using the address of operator (the ampersand) when calling triple:

   triple(&number);

This passes the address of the number variable to triple, instead of making a copy. Now, we have an argument to triple, named pointer, which is a pointer to an integer. When called, this variable points to the number variable in main allowing triple to change the variable in main. Inside triple, it dereferences the pointer, which sets n to five, initially, by looking inside the box of the number variable. Then it multiplies n by three. Finally, we dereference the pointer, again, to put the result, fifteen, back into the original box. This is really no different than our example in Listing 8, except we've now used a pointer as an argument to a function. It's also worth noting that we can shorten the triple function to:

void triple(int * pointer)
{
   *pointer = (*pointer) * 3;
}

This eliminates the temporary variable n and does the modification on one line. I added extra parenthesis on the right hand side to make sure the star for dereferencing the pointer is not confused with a star used for multiplication.

Communicating with the User

Okay, again that was a bit of a contrived example. So when is this useful in your own program? One case is when you want to get input from the user. Here is a simple program to get the user's age using a standard function called scanf:

Listing 11: main.c Asking the user's age

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   printf("What is your age? ");
   scanf("%d", &age);
   printf("Your age is: %d\n", age);
   
   return 0;
}

This time, when you run the program, it will stop, waiting for you to type your age into the Run Log window. Type it in, and press Return. Here's what I did:

What is your age? 33
Your age is: 33

The first 33 in bold red is what I typed in. On the next line, you can see it printed my age back to me. What happened here? scanf is a function that reads user input, but it needs to store this result somewhere. By using a pointer, we can pass the address of the age variable, and scanf can store the user's response in age. The %d here is similar to a %d used in printf, and tells scanf to read an integer from the user.

Now that we can communicate with the user, it's getting interesting. Just to spice this up, let's add an if statement that tells you if you are allowed to vote in the United States, similar to what we did in Listing 5:

Listing 12: main.c Can the user vote?

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   printf("What is your age? ");
   scanf("%d", &age);
   printf("Your age is: %d\n", age);
   if (age >= 18)
      printf("You are allowed (and should!) vote\n");
   else
      printf("Sorry, you are not allowed to vote, yet\n");
   
   return 0;
}

Try running this a couple times, first using an age greater than or equal to eighteen, and again using an age less than eighteen.

Putting it All Together

Lying about your age isn't all that fun, so let's put it all together by writing a simple number guessing game. Here's the code to the entire game:

Listing 13: main.c    Number guessing game
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Generate a random number between 1 and 32
int generate_random_number(void)
{
   // "Seed" the random number generator
   srand(time(NULL));
   int random_number = rand();
   return (random_number % 32) + 1;
}
void play_game(void)
{
   int random_number;
   int guess;
   int count;
   
   random_number = generate_random_number();
   count = 0;
   printf("I am thinking of a number between 1 and 32.\n");
   printf("How quickly can you guess it?\n");
   do
   {
      printf("What is your guess? ");
      scanf("%d", &guess);
      if (guess < random_number)
         printf("You guessed too low. Try again.\n");
      else if (guess > random_number)
         printf("You guessed too high. Try again.\n");
      count++;
         
   } while (guess != random_number);
   printf("You guessed it correctly!\n");
   printf("It only took you %d guesses.\n", count);
}
int main(int argc, const char * argv[])
{
   play_game();
   
   return 0;
}

Hopefully there are not too many surprises here. The only part we have not covered is generating a random number. The rand function is supposed to generate a random number between zero and 2147483647. However, there is one gotcha. If you don't seed the random number generator, it will always return the same sequence of numbers. Since this would not make a very fun game, we are using the current time as a seed. If you don't understand this, don't worry. Just trust me that it's necessary to make this game fun.

Okay, so rand gives us a number between zero and 2147483647, but we really want a number between one and thirty-two. The percent sign is a mathematical operator called the modulo operator that returns the remainder of a division. Think back to grade school math and remember that when dividing a number, you get a quotient and a remainder. For example, if you divide 53 by 10, the quotient is 5 and the remainder is 3. A fancy name for doing division and returning the remainder is called taking the modulo of a number, or just mod for short. The nice thing about the modulo is that its value is always between zero and the divisor minus one. Thus the expression (random_number % 32) always returns a number between zero and thirty-one. Since we want a number between one and thirty-two, we need to add one to it.

Phew! Creating a random number was a little complicated, but given your new knowledge of loops, conditional statements, and pointers, you should be able to understand the rest of the program. The play_game function keeps asking the user for a guess and only stops if the user guesses correctly. It also gives a little hint to the user so she or he can refine their guess. We added two more #include statements, because we are now using other functions that are not declared in stdio.h. rand and srand are declared in stdlib.h, and time is declared in time.h.

Here is a sample session of a game.

I am thinking of a number between 1 and 32.
How quickly can you guess it?
What is your guess? 16
You guessed too low. Try again.
What is your guess? 24
You guessed too high. Try again.
What is your guess? 20
You guessed too low. Try again.
What is your guess? 22
You guessed it correctly!
It only took you 4 guesses.

Play the game yourself a few times, and see how well you can do. With the correct strategy, you should always be able to guess correctly in five guesses or less. Read over the code again, and see if you can follow along as you type. Just to make sure you understand, try adding another do/while loop in main that asks the user if they would like to play again. I'll give you a small hint:

   play_game();
   printf("Enter (1) to play again: ");
   scanf("%d", &response);

See if you can figure out the rest!

Conclusion

We covered a lot of ground this month, from loops and conditional statements to pointers. I know pointers can be a bit tricky. If it's still not clear to you, I suggest writing some code, yourself. Pointers can definitely be difficult to understand by reading alone, so dive in and start playing around. Think about it this way: in just two months, you now know how to write a simple game. That's some good stuff. See what you can do on your own with what we've covered. Programming might take some practice, but it can be fun!

Footnotes

[1]: This is technically incorrect. Pointers should use the %p format string, instead of %u. Unfortunately, %p prints the address in hexadecimal, which is an advanced topic we'll cover later.


Dave Dribin has been writing professional software for over eleven years. After five years programming embedded C in the telecom industry and a brief stint riding the Internet bubble, he decided to venture out on his own. Since 2001, he has been providing independent consulting services, and in 2006, he founded Bit Maki, Inc. Find out more at http://www.bitmaki.com/ and http://www.dribin.org/dave/>.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.