Showing posts with label Projects. Show all posts
Showing posts with label Projects. Show all posts

Thursday, October 25, 2018

Updating File Data using fseek


File Management - Updating File Records


Following program will allow us to change marks of roll no. 101 using fseek() function. Content of "student.txt" (RollNo, Marks, Name) file is as under:

101 50 AAA
102 60 BBB
103 65 CCC

#include <stdio.h>

int main () {
   FILE *fp;
   char str[80];
   int newmarks;
   
   fp = fopen("student.txt","r+");

   printf("Original File Data:\n");
   while(fgets(str,80,fp)!=NULL)
    printf("%s", str);
   //getch();
   
   printf("\n\nEnter new marks of Roll no. 101:");
   scanf("%d", &newmarks);
      
   printf("Updated File Data:\n\n");
   
   itoa(newmarks,str, 10); //convert int to string; fputs() write "string" to fp
   
   fseek(fp, 4, 0); //set the pointer to position no. 4
   
   fputs(str, fp);  //write string to current position of fp
   fclose(fp);
   
   fp = fopen("student.txt","r");

   while(fgets(str,80,fp)!=NULL)
    printf("%s", str);
   
   fclose(fp);
   getch();
   return(0);
}


Output of Program

Original File Data:
101 55 AAA
102 60 BBB
103 65 CCC

Enter new marks of Roll no. 101:75

Updated File Data:
101 75 AAA
102 60 BBB
103 65 CCC

Monday, October 22, 2018

Login Check Function


User Authentication (Login Check Function)

This C program will check the User ID and Password entered by user with the UserID and Password stored into login.txt file. Each line of login.txt contains UserID Password of one user. 

Sample login.txt file contains data of 5 users which are as under:

101 abc123
102 guest
103 hi
guest guest
admin admin

Make sure that each user ID and Password is separated by space.

#include<stdio.h>

int Login_check(char id[], char pass[]);

int main()
{
 int check=0;
 char id[20], pass[20];
 printf("Enter your User ID:");
 scanf("%s", id);

 printf("Enter your Password:");
 scanf("%s", pass);

 check = Login_check(id, pass);

 if (check==1)
   printf("\nLogin successful...\n\nDisplay Menu Here...\n");
   //write main program logic here...  
 else
   printf("\nLogin failed. Try again...\n");

 return 0;
}

int Login_check(char id[], char pass[])
{
 FILE *fp;
 char *fid, *fpass, *token;
 int check=0;
 const char str[40] = "", s[2] = " ";

 fp = fopen("login.txt", "r");

 if(fp==NULL) 
 {
   printf("File error..."); exit(0);
 }
 while(fgets(str, 40, fp)!=NULL)
 {
   fid = strtok(str,s);
   fpass = strtok(NULL,s);
   fpass[strlen(fpass)-1]='\0';

   if((strcmp(id,fid) == 0) && (strcmp(pass,fpass) == 0 ))
   {
     check=1;
   }
 }
 return check;
}

Output of Program

Enter your User ID:guest
Enter your Password:guest

Login successful...

Display Menu Here...


Sunday, October 7, 2018

Graphical Report - Project Demo


Project Demonstration - Graphical Reports 

This project shows how to generate Graphical Reports of Student's Class Test from "classtest.txt" data file without use of <graphics.h>. 

Assume classtest.txt file contains RollNo and MarksObtained by the students. This program will display horizontal BAR chart of the Marks obtained by the students.

#include<stdio.h>
int main()
{
  FILE *fp;
  int marks, i;
  const char str[80], s[2]=" ";
  char *token;

  fp = fopen("classtest.txt","r");

  if(fp == NULL) { printf("File error.."); exit(0); }

  system("color A1");
  printf("  Class Test Graphical Report(2018)\n");
  printf("=====================================\n");
  printf(" Roll No.| Marks Obtained (Out of 20)\n");
  printf("=====================================\n");

  while(fgets(str,80,fp)!=NULL)
  {
token = strtok(str,s);
printf("     %s   | ", token);
token = strtok(NULL, s);
marks = atoi(token);
for(i=0; i<marks; i++)
  printf("%c", 254);
printf(" %d\n", marks);
  }
  fclose(fp);
  return 0;    
}

Output of Program

Project Demonstration - Graphical Report of Student Class Test

Check more interesting projects here..


Friday, October 5, 2018

Colors in C Project


Using Colors in C Project

Following C code demonstrates how to use Colors in C program without using <graphics.h>.

#include<stdio.h>

int main()
{
  int i;
  printf("\n\n\n");
  for(i=0;i<10;i++)
  {
     system("color B1");
     printf("%c ",254);
  }
  printf("\n\n MAIN MENU \n\n");
  for(i=0;i<10;i++)
  {
      system("color A1");
      printf("%c ",254);
  }
  return 0;    
}

Output of program
Colors in C Program
Adding Colors to C Program

Sunday, September 30, 2018

Main Menu Demo Project


Main Menu Demo Project 

  • This project will demonstrate how to create and use Main Menu in project.
  • Project uses concepts of Functions to implement project.

Following Program Demonstrate how to use MAIN MENU in C Project based on Library Management System.

#include<stdio.h>

void MainMenu();
void DrawLine(int n);
void AddBooks();
void AddStudentRecords();
void SearchBooks();
void IssueBooks();
void DisplayBooks();
void EditBooks();

int main(){

MainMenu();

return 0;
} //End of Main function

void MainMenu(){
int choice;
char chr;
system("cls");
DrawLine(15);
printf(" MAIN MENU ");
DrawLine(15);
printf("\n\t1. Add Books\n");
printf("\t2. Add Student Record\n");
printf("\t3. Search Books\n");
printf("\t4. Issue Books\n");
printf("\t5. Display Books\n");
printf("\t6. Edit Book Records\n");
printf("\t7. Exit System\n");
DrawLine(41);

printf("\nEnter your choice:");
scanf("%d", &choice);

switch(choice){
case 1:
AddBooks();
break;
case 2:
AddStudentRecords();
break;
case 3:
SearchBooks();
break;
case 4:
IssueBooks();
break;
case 5:
DisplayBooks();
break;
case 6:
EditBooks();
break;
case 7:
printf("Exiting System...\n");
printf("\nAre you sure!!!\nPress Y/y to Exit and N/n to Continue..");
chr = getch();
if(chr == 'Y' || chr == 'y')
printf("\nHave a Nice Day..");
else
MainMenu();
break;
default: printf("Invalid Input...Try again...");
break;
}
}//End of MainMenu
void DrawLine(int n){
int i;
for(i=0; i<n; i++)
printf("%c",254);
}
void AddBooks(){
system("cls");
DrawLine(30);
printf("\nAdd Logic of Add Books here...\n");
DrawLine(30);
getch();
MainMenu();
}

void AddStudentRecords(){
system("cls");
DrawLine(30);
printf("\nAdd Logic of Student Record here...\n");
DrawLine(30);
getch();
MainMenu();
}

void SearchBooks(){
system("cls");
DrawLine(30);
printf("\nAdd Logic of Search Books here...\n");
DrawLine(30);
getch();
MainMenu();
}

void IssueBooks(){
system("cls");
DrawLine(30);
printf("\nAdd Logic of Issue Books here...\n");
DrawLine(30);
getch();
MainMenu();
}

void DisplayBooks(){
system("cls");
DrawLine(30);
printf("\nAdd Logic of Display Books here...\n");
DrawLine(30);
getch();
MainMenu();
}

void EditBooks(){
system("cls");
DrawLine(30);
printf("\nAdd Logic of Edit Books here...\n");
DrawLine(30);
getch();
MainMenu();
}
//This code is developed by CProgramPracticals.Blogspot.Com
//Give reference to CProgramPracticals.Blogspot.Com site while using this code.

Sample Output
Library Management System - Sample Main Menu C Project
Fig. Sample Output for Project Library Management System - Main Menu Code



Monday, February 12, 2018

Top Project Titles

101 Top Project Titles


  1. Android Based Business Card Scanner
  2. Android Based Wireless PC Controller
  3. ATM Reporting system
  4. Audio Manager
  5. Bandwidth-Allocation-for-Distributed-Algorithm
  6. Bank Management System
  7. Bluetooth Home Automation
  8. BLUETOOTH HOTSPOT
  9. Bluetooth Project
  10. Brand Analysis with Twitter Data
  11. Bug Tracking System
  12. Bus Locator
  13. Chat Server
  14. Chat Server and Client Application
  15. Children Monitoring System using RFID
  16. Collaboration Server
  17. Computer Troubleshooting Intelligent System
  18. Congestion control in ATM-based Broadband ISDNs
  19. Credit Card Fraud Detection
  20. Credit Card Reader with Face Recognition based on Webcam
  21. Customer Complaint Report Software
  22. Data Warehousing and Data Mining Dictionary
  23. Design of Secure File Transfer over Internet
  24. Development of an Online Course Portal
  25. Driver Drowsiness Detection System
  26. Electronic Mail Server
  27. E-Mail Campaign System
  28. Employee Tracking System
  29. eQuestion Generator
  30. Face Detection And Recognition For Automatic Attendance System
  31. Face Recognition in e-attendance
  32. File Compression
  33. Fingerprint Verification System Based on a Correction
  34. Generic SQL Explorer
  35. Health Centre Monitoring System
  36. Hospital Management System
  37. Image Steganography
  38. Implementation of Security in WAN
  39. Insurance Database
  40. Intelligent Eye
  41. Internet Based Monitoring of Remote Electrocardiogram
  42. Intruder Detection System Over Abnormal Internet Sequence
  43. Intrusion detection system
  44. Inventory Management System
  45. Log Reader Based Code Analyzer
  46. Management System of Pharmacy in MySQL and PHP
  47. Medical Inventory and Billing System
  48. Mood based Music System
  49. Multi-Tasking Sockets
  50. Network Monitoring for Remote Task Executor
  51. Network Security Implementation Layer through Voice Biometric
  52. Next Generation Electronic Voting Machine
  53. Online Bus Reservation
  54. Online Examination System
  55. Portable Media Player
  56. Query Processing in Global Information Systems
  57. Railway Route Optimization System
  58. Result Alert System With E-mail and SMS
  59. Resume Builder
  60. Search Engine
  61. Secure Group Communication
  62. Secured Banking Transaction Using Virtual Password
  63. Security System For DNS Using Cryptography
  64. Sliding Window Protocol
  65. Smart Card Security and Static Analysis Perspective
  66. Smart Ration Card System using RFID and Biometrics
  67. Smart Video Surveillance Security System for Hazard Situations
  68. SMTP Mail Server
  69. Social Networking
  70. Spam Mail Detection using Classification
  71. Student Attendance Management System
  72. Student Information System
  73. Student Registration System
  74. SUDOKU
  75. Suspicious Object Detection System
  76. Telephone Billing System
  77. Time Table Generator
  78. Trade Service Engine
  79. Traffic Management in Smart Cities
  80. Training & Placement Cell Management
  81. Universal Web Based File Coordinator
  82. Vehicle Management System
  83. Virtual Class Rooms
  84. Virtual Lab Control Using Android Phone
  85. Virtual Shopping
  86. Voice based E-mail for the Blind
  87. Web based Applications for Insurance Services
  88. Web Based Bus Ticket Reservation System
  89. Web Based Graphical Password Authentication System
  90. Web Based Online Blood Donation System
  91. Web Mining
  92. Student Progress Management System
  93. Marksheet Generators
  94. Salary Generators
  95. Income Tax Generators
  96. Resource Management System
  97. Mobile Security
  98. Light Management System
  99. Device Monitoring
  100. Vehicle Monitoring System
  101. Zoo Management System