Professional Documents
Culture Documents
Internal Components:
1. Motherboard: The main circuit board that houses the CPU, RAM slots, expansion slots,
and other essential components.
2. CPU (Central Processing Unit): The brain of the computer that performs calculations
and executes instructions.
3. RAM (Random Access Memory): Temporary storage used by the CPU to store data
and program instructions that are currently in use.
4. Hard Drive or SSD (Solid State Drive): Internal storage for storing the operating
system, programs, and user data.
5. Power Supply Unit (PSU): Converts AC power from the wall outlet into DC power for
the computer's components.
6. Graphics Card (GPU): Responsible for rendering images and videos, especially in
tasks like gaming or graphic design.
7. Expansion Cards: Additional cards that can be installed into expansion slots on the
motherboard, such as sound cards, network cards, or additional USB ports.
External Components:
1. Keyboard: Input device used for typing text and issuing commands to the computer.
2. Mouse or Trackpad: Input device used for navigating graphical user interfaces and
selecting items on the screen.
3. Monitor or Display: Output device that displays the computer's graphical interface and
output.
4. Speakers or Headphones: Output devices used for audio playback.
5. External Storage Devices: Devices such as external hard drives or USB flash drives
used for additional storage.
6. Printer or Scanner: Peripherals used for printing documents or scanning images.
7. Network Devices: Devices such as routers, switches, or modems used for connecting
the computer to a network or the internet.
2.PROCESSING
The central processing unit (CPU) inside the computer then takes that binary code and does the
calculations needed to get that data to display in a way that makes sense to the user.
3.STORAGE
Storage is where the computer takes the input and stores it in its memory banks.
4.OUTPUT
Output is where the computer takes the pixels from the processing stage and displays them in a
way that the user can see them. There are many kinds of output devices, such as printers, screens,
video and audio devices.
5.COMMUNICATION
Database Practical
1.Create two tables with at least five fields having different data types, also specify
appropriate primary keys.
Create relationship between them Enter at least five records using forms
Design a query or report depending on specific criteria
Create two tables in a relational database along with their fields, primary keys,
and then establish a relationship between them.
Relationship:
One-to-Many (Each department can have multiple employees, but each employee belongs to
only one department)
Employees Table:
Departments Table:
Now, for designing a query, let's say we want to retrieve the list of employees who are
born after 1990 and work in the Sales department:
This query will return the First Name, Last Name, DateOfBirth of employees who are
born after 2000 and work in the Sales department.
HSSC Part-II
C++ Practical
Practical 1:
Program using: cin, cout, escape sequences, setw
Solution: Below is a simple C++ program that utilizes cin, cout, escape sequences,
and setw to display formatted output.
Escape Sequence
#include <iostream>
int main()
cout<<"\'C\'\t\'L\'\t\'i\'\t\'n\'\t\'i\'\t\'c\'\n";
cout<<"\"Electronic\"\n";
Output
setw manipulator
#include <iostream>
#include <iomanip>
Usingnamespace std;
int main () {
cout << std::setw(5);
cout <<123<< std::endl;
return 0;
}
Output:
int main()
{
if (3 < a < 10)
{
std::cout << "Yes" << std::endl;
}
else
{
std::cout << "No" << std::endl;
}
return 0;
}
The mathematical expression 3 < a < 15 means “3 is less than a and a is less
than 15.”
Practical 3: Reading a number and find out whether it is prime or
composite.
#include <iostream>
using namespace std;
int main() {
int number;
bool isPrime = true;
// Check if the number is divisible by any number other than 1 and itself
for (int i = 2; i <= number / 2; ++i) {
if (number % i == 0) {
isPrime = false;
break;
}
}
return 0;
}
Practical 4: Generating and summing simple series in C++.
Program:
#include <iostream>
using namespace std;
int main() {
int n;
double sum = 0.0;
return 0;
}
Output:
Enter the number of terms in the series: 5
Sum of the series: 2.28333
int main() {
int number, reversedNumber = 0, remainder;
return 0;
}
Output:
If you run the provided C++ program and input a number, let's say 123, the program will output
the reversed number, which will be 321.
Here's the output when you input 123:
Enter a number: 123
Reversed number: 321
int h = (day + ((13 * (month + 1)) / 5) + year + (year / 4) - (year / 100) + (year /
400)) % 7;
Output:
Enter the year: 2024
Enter the month (1-12): 4
Enter the day of the month: 1
The day of the week for 4/1/2024 is: Monday
int main() {
int num1;
double num2;
float num3;
return 0;
}
Output:
Enter an integer number: 5
Enter a double number: 3.5
Enter a float number: 2.1
Sum of the integer and double numbers: 8.5
Sum of all three numbers: 10.6
int main() {
int number = 10;
int *ptr = &number; // Pointer pointing to the address of 'number'
return 0;
}
Output:
Address of the variable: 0x7ffd8889f76c
Value of the variable: 10
Address using pointer: 0x7ffd8889f76c
Value using pointer: 10
int main() {
// Create an object of the Student class
Student student1;
return 0;
}
Output:
Student Details:
Name: Samiullah
Age: 20
Class: 12th Grade
int main() {
// Create a file stream object
ofstream outFile;
return 0;
}
Output:
Contents of the file:
Hello, this is a sample data file.
It contains some text data.
You can read this data from another program.
End