Try the fastest way to create flashcards
Question

Write a program that displays the word UP on the bottom line of the screen a couple of inches to the left of center and displays the word DOWN on the top line of the screen a couple of inches to the right of center. Moving about once a second, move the word UP up a line and the word DOWN down a line until UP disappears at the top of the screen and DOWN disappears at the bottom of the screen.

Then, modify the program so that after disappearing off of the screen, the word UP reappears at the bottom of the screen and the word DOWN reappears at the top of the screen. The words should continue moving until the user presses the [Enter] key to terminate the program.

Solutions

Verified
Answered 6 months ago
Step 1
1 of 7

This program exercise uses windows.h library to display an animation. Let’s start by importing it and defining a namespace

#include<iostream>
#include<windows.h>

using namespace std;

Create a free account to view solutions

Create a free account to view solutions

Recommended textbook solutions

Computer Organization and Design MIPS Edition: The Hardware/Software Interface 5th Edition by David A. Patterson, John L. Hennessy

Computer Organization and Design MIPS Edition: The Hardware/Software Interface

5th EditionISBN: 9780124077263David A. Patterson, John L. Hennessy
226 solutions
Starting Out with C++: Early Objects 8th Edition by Godfrey Muganda, Judy Walters, Tony Gaddis

Starting Out with C++: Early Objects

8th EditionISBN: 9780133360929Godfrey Muganda, Judy Walters, Tony Gaddis
844 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
948 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionISBN: 9780262033848 (3 more)Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
872 solutions

More related questions

1/4

1/7