In a Military database system, IDs of the army personnel are stored in a 32-bit value
which is coded as follows:
a. 7-bits Belt number
b. 10-bits Batch number
c. 5-bits Log number
d. 10-bits Unit number
Your Task is to write a C++ Program which inputs a four-byte integer ID, and a string Name of the
army man. Your Program will separate the Belt number, Batch number, Log number and Unit
number and prints the information in the following manner.
Enter Name of Army Man Khan
Enter ID of Army Man: 858993459
Belt number of Khan is : 51
Batch number of Khan is: 614
Log number of Khan is: 25
Unit number of Khan is: 204
take a scenario where we need to design a function that is supposed to process a vector with 10,000,000 elements.
Question #261249
Using the node from task 2, implement a class called DLL with following functionalities
1. insert a node at first ,
2. overload to Insert a node at last
3. overload to Insert at specified position of double linked list. E.g if the position number is 6, it is inserted between node at position 5 and 7. If position number is greater than the size of list.
1. eliminate duplicates from doubly linked list
2. delete a node from first,
3. overload to delete a node from last
4. overload to delete at specified position of double linked list. E.g if the position number is 6, it is deleted from between node at position 5 and 7. If position number is greater than the size of list, it is prompted that the position number does not exist and therefore is being deleted from the end.
5. Make a sub menu to Merge 2 doubly list. Let there be 2 lists L1, L2
a. Press 1 to append L1 to L2.
b. Press 2 to append L2 to L1.
c. Press 3 to merge L1 and L2 in sorted order.
#include<iostream>
using namespace std;
int area(int);
int area(int,int);
float area(float);
float area(float,float);
int main()
{
int a,length,b;
float radius,base,ht;
cout<<"enter one side of the square";
cin>>a;
cout<<"enter length and breadth the rectangle:";
cin>>length>>b;
cout<<"enter the radius of the circle:";
cin>>radius;
cout<<"enter the base and height of the triangle:";
cin>>base>>ht;
cout<<"Area of square = "<<area(a);
cout<<"\nArea of rectangle = "<<area(length,b);
cout<<"\nArea of circle = "<<area(radius);
cout<<"\nArea of triangle = "<<area(base,ht);
}
int area(int a)
{
return(a*a);
}
int area(int length,int b)
{
return(length*b);
}
float area(float radius)
{
return(3.14*radius*radius);
}
float area(float base,float ht)
{
return((base*ht)/2);
}
Output
Create a program that will compute the 1st quiz 11/11 2nd quiz 15/15 and the 3rd quiz 20/20 with 10% of quiz and compute the online laboratory 1st 15/20 2nd 10/20 3rd 5/20 with 30% of online laboratory and compute the exam with 20% 1st exam 30/50 2nd exam 45/50 3rd exam 20/50 and compute the quiz+online+ exam1+exam 2+ exam 3
You will be simulating an airport where 8 planes go out on tours repeatedly. Each tour will be for exactly 12 passengers and last approximately 30 seconds. In performing the simulation, you must make sure that no plane tries to leave a gate with less (or more) than 12 passengers
and that no plane lands or takes off at the same time as another plane is landing or taking off.
The first thing your program should do is read the following from the command line (in the
order specified):
1.Try running your program with only 11 passengers. What happens? Why?
2. Try running your program with 12 passengers. What happens? Why?
3. Try running your program with 50 passengers and 100 tours. What happens? why?
4. Try running your program with 100 passengers and 20 tours. What happens? Why?
5. What is the minimum number of passengers that will guarantee avoidance of
deadlock? Why?
Starlight company has revised their employs salaries they had certain criteria on which they decided the total increment value of employee on their salary following
1. 10%increase if he has only worked on company's local project
2.15%increase if he has only worked on company's international projects
3.20%increase if he has worked one company's both local and international projects
Now you are required from to ask your 3 employees there names salary's and calculate the total salary they will get this month
You output should display old salary of each employee and new salary get now he will get
Write a function that computes the average of the digits in an integer and use the following function header.double average Digits(long n)
There are 12 teams in the tournament and every team will play
one match each on the knock-out basis in the first round. It means that the losing team of every match
leaves the tournament while the winning team continues to play the next match. From the twelve teams,
six winning teams will play another knock-out match. From these six teams, three winning teams will play
against each other on the round robin basis (i.e. team A plays against team B, team B plays against team
C, and team C plays against team A). The top two teams from this round will move to the final match. In
case all the teams win one match each at this stage, then there will be a toss to move one team to the
final while the other two teams will play against each other and the winner moves to the final.
For every match, you can generate a random number to declare the winner of the match. Similarly, you
can use a random number to simulate the toss. You are required to use if-else (if-else-if) structure to run
22. Make a program that will input minutes and convert it into seconds. Your program will be terminated when you input zero in the minutes.