Professional Documents
Culture Documents
VVIT PAL
1
Mobile keypad using c++ graphics
INTRODUCTION:
In today's digital age, mobile phones have become an integral part of our lives.
Simulating a mobile device's keypad and interface using C++ and computer graphics is a
fascinating micro project that offers an opportunity to hone your programming and
graphics design skills. This project will enable you to create a visually appealing and
interactive mobile keypad interface on your computer screen, providing users with a
familiar experience.
**Project Objectives:**
3. **User Interaction:** Implement functionality that allows users to interact with the
keypad, press buttons, and simulate keypress events.
4. **Feedback and Visual Effects:** Incorporate visual feedback for button presses, such
as highlighting or changing button colors, and display characters or symbols when a
button is pressed.
6. **Error Handling:** Create error handling mechanisms for scenarios like incorrect pin
entries or menu selections.
- **C++ Programming:** Enhance your C++ programming skills by creating the core
functionality for the mobile keypad simulator.
- **Computer Graphics:** Learn how to use graphics libraries (e.g., OpenGL and GLUT)
to create the graphical user interface and visualize the keypad.
VVIT PAL
2
Mobile keypad using c++ graphics
- **User Interface Design:** Develop user interface design skills, focusing on layout,
buttons, fonts, and overall aesthetics.
- **User Interaction:** Implement event handling to enable users to interact with the
keypad and navigate through screens.
**Outcome:**
By the end of this micro project, you will have a fully functional keypad mobile simulator
running on your computer. This project will give you practical experience in
programming and computer graphics while allowing you to explore user interface design
principles. Additionally, you'll gain a deeper understanding of how real mobile devices
work at the software and interaction levels.
VVIT PAL
3
Mobile keypad using c++ graphics
Source code
// C program for the
// above approach
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
// Driver Code
void main()
{
int gd = DETECT, gm;
VVIT PAL
4
Mobile keypad using c++ graphics
// Main Outline
rectangle(800, 100, 1100, 730);
VVIT PAL
5
Mobile keypad using c++ graphics
void screen()
{
// Screen Outline
rectangle(830, 130, 1070, 370);
VVIT PAL
6
Mobile keypad using c++ graphics
void key()
{
int l = 820, t = 500, i = 1;
VVIT PAL
7
Mobile keypad using c++ graphics
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"4 GHI");
}
else if (i == 5) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"5 JKL");
}
else if (i == 6) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"6 MNO");
}
else if (i == 7) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"7PQRS");
}
else if (i == 8) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"8 TUV");
}
else if (i == 9) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"9WXYZ");
VVIT PAL
8
Mobile keypad using c++ graphics
}
else if (i == 10) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"* +");
}
else if (i == 11) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"0 _");
}
else if (i == 12) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"# x");
}
i++;
l = l + 100;
}
t = t + 50;
l = 820;
}
}
void others()
{
setfillstyle(SOLID_FILL,
WHITE);
VVIT PAL
9
Mobile keypad using c++ graphics
// Implement Microphone
circle(900, 710, 5);
floodfill(902, 712, 15);
// Implement Speaker
rectangle(900, 110, 1000, 120);
setfillstyle(XHATCH_FILL, WHITE);
floodfill(905, 115, 15);
// Division Between
// Screen and Keys
line(800, 400, 1100, 400);
}
void menu_key()
{
setfillstyle(SOLID_FILL, WHITE);
VVIT PAL
10
Mobile keypad using c++ graphics
// Menu Key
rectangle(930, 420, 980, 470);
rectangle(920, 410, 990, 480);
settextstyle(10, 0, 3);
outtextxy(940, 430, "OK");
floodfill(925, 415, 15);
VVIT PAL
11
Mobile keypad using c++ graphics
Output
VVIT PAL
12
Mobile keypad using c++ graphics
VVIT PAL
13
Mobile keypad using c++ graphics
Conclusion
The "Design and Implement a Keypad Mobile Simulator Using C++ and Computer Graphics"
micro project has been a stimulating journey that has allowed us to explore the world of
programming, computer graphics, and user interface design. Throughout this project, we set out
to create a simulated mobile phone keypad with an intuitive user interface, providing users with a
familiar and interactive experience.
2. **Keypad Design:** The project included the creation of a realistic keypad, complete with
numerical buttons, navigation keys, and other essential features typically found on a mobile
device.
3. **User Interaction:** Users were able to interact with the keypad, simulate keypress events,
and receive visual feedback upon button presses.
5. **Error Handling:** Error handling mechanisms were included to address scenarios such as
incorrect pin entries or menu selections, making the simulator more realistic.
VVIT PAL
14
Mobile keypad using c++ graphics
- **C++ Programming:** We enhanced our C++ programming skills by developing the core
functionality for the keypad simulator. We learned to structure the code effectively and manage
data and user interactions.
- **Computer Graphics:** The utilization of graphics libraries (e.g., OpenGL and GLUT)
introduced us to the world of computer graphics, allowing us to create the visual aspects of the
keypad mobile simulator.
- **User Interface Design:** We explored user interface design principles, focusing on layout,
button design, font selection, and overall aesthetics. This skill will be valuable for future projects
involving graphical user interfaces.
- **User Interaction:** Event handling was implemented to enable users to interact with the
keypad, fostering an understanding of how software interacts with the user.
The project not only met its primary objectives but also offered an opportunity for creativity and
personalization. Additionally, it allowed for further exploration and expansion, which can include
the addition of advanced features, further customization, and the introduction of more
sophisticated mobile phone functions.
VVIT PAL
15