Write a program to output the following
Hello
There
Create a program to generate student attendance record in which teacher mark absent or present of each student and student have capability to see their attendance record of their each subjects.
Note: Your work must be done on console application.
A school maintains academic record of its students (of a class) in different arrays. The information stored is:
1. Roll Number (in an integer array)
2. Midterm Marks (in a float array)
3. Final Marks (in a float array)
4. Class of a student e.g. Class 1, Class 2, Class 3 (in an integer array)
5. The Grades based on final marks (in char array)
a. Final Marks less than 50 – F
b. Final Marks: 50 to 59 (both inclusive) – D
c. Final Marks: 60 to 72 (both inclusive) – C
d. Final Marks: 73 to 85 (both inclusive) – B
e. Final Marks: 86 and above – A
This program can display data from the existing student record. At the start of program, a menu will be displayed. The program will continue to work until e or E is entered. Error message will be displayed if any number (or a character) other than the given option is entered. Each array must have a size 100 and for the sake of my convenience, the arrays should be populated with exactly 50 student entries. The roll numbers must be unique – you have to take care of this.
The main menu must be the following (the comments written in the menu below are for your understanding and SHOULD not be displayed as such):
1. Sort and display all the records roll number wise in ascending order. /*When this option is selected, the output should be:
Roll No: 25 Midterm Marks: 10.5 Final Marks: 55 Class: 6 Grade: D
Roll No: 45 Midterm Marks: 8 Final Marks: 55 Class: 7 Grade: D
Roll No: 66 Midterm Marks: 36 Final Marks: 75.5 Class: 6 Grade: B
. . . .
.
. . . .
.
. . . . outputs for options 2-8 must be similar to option 1/*
.
2. Sort and display all the records roll number wise in descending order.
3. Sort and display all records in ascending order based on marks in Midterm
4. Sort and display all records in descending order based on marks in Midterm
5. Sort and display all records in ascending order based on marks in Final
6. Sort and display all records in descending order based on marks in Final
7. Sort and display all records in ascending order based on Grade 8. Sort and display all records in descending order based on Grade 9. Add a new entry of a student.
/*Assuming that the arrays got sorted after option 1 was selected, the new student entry which got added is shown below. Addition must be done on the next available index. You must ensure that the arrays are not full. In this option you will also make sure that the roll number that is being entered in unique:
10. Delete a student record based on his roll number.
/*In this option, the user will enter a roll number and the whole data related to it must be deleted. The entries must be shifted so that there is no space in between any entry. Assuming that the user enters 66, the arrays after deletion are shown below:
11. Display record of all the students greater than X marks in final exam (in descending order with respect to marks obtained in final exam). The value of X will be entered by the user.
12. Display record of all the students greater than X marks in final exam (in ascending order with respect to marks obtained in final exam). The value of X will be entered by the user.
13. Display record of all the students less than or equal to X marks in final exam (in descending order with respect to marks obtained in final exam). The value of X will be entered by the user.
14. Display record of all the students less than or equal to X marks in final exam (in ascending order with respect to marks obtained in final exam). The value of X will be entered by the user.
15. Display record of all the students greater than X grade (in descending order with respect to grade). The value of X (character) will be entered by the user.
16. Display record of all the students greater than X grade (in ascending order with respect to grade). The value of X (character) will be entered by the user.
17. Display record of all the students less than or equal to X grade (in descending order with respect to grade). The value of X (character) will be entered by the user.
18. Display record of all the students less than or equal to X grade (in ascending order with respect to grade). The value of X (character) will be entered by the user.
A machine purchased for RM28,000 is depreciated at a rate of RM4,000 a year for 7 years.
Write and run a C++ program that computes and displays a depreciation table for 7 years.
Write a program that prompts the user to input the x-y coordinate of a point in a Cartesian plane.
The program should then output a message indicating whether the point is the origin, is located
on the x-axis or y-axis, or appears in particular quadrant (1st quadrant, 2nd quadrant, 3rd quadrant
or 4th quadrant).
Write a program that prompts the user to input the x-y coordinate of a point in a Cartesian plane.
The program should then output a message indicating whether the point is the origin, is located
on the x-axis or y-axis, or appears in particular quadrant (1st quadrant, 2nd quadrant, 3rd quadrant
or 4th quadrant).
Turn this program into C++ CLASS AND OBJECTS.
Company ABC, an airline company is closely monitoring the distance between airplanes as they take-off on the same airport. You are asked to create a system that would calculate the distance between two planes A and B given the following plane attributes: Take-off Time, Speed (mi/hr), direction (north, east, west, south). Also, given the time where the navigation officer would like to check the distance.
.
#include <iostream>
using namespace std;
int main()
{
int flightNo1=0, flightNo2=0, speed1=0, speed2=0;
char direction1[5];
char direction2[5];
int time1=0, time2=0, distance=0;
cout<<"-----------You are welcome in ABC Airline Co.------------"<<endl;
// First flight details
cout<<" Please enter the flight name: "<< endl;
cin>>flightNo1;
cout<<"Please enter flight number:"<<flightNo1 <<"take off time:"<< endl;
cin>>time1;
cout<<"Please enter the speed of flight number:"<<flightNo1 << endl;
cin>>speed1;
cout<<"The speed of the flight number:"<<flightNo1<<"is:"<<speed1<<endl;
cout<<"Please enter the direction of flight number:"<<flightNo1 << endl;
cin>>direction1;
cout<<"The direction of the flight number:"<<flightNo1<<"is:"<<direction1<<endl;
// second flight detail
cout<<" Please enter the flight Number of second flight "<< endl;
cin>>flightNo2;
cout<<"Please enter the take off time of the flightNo2 :"<<flightNo2<< endl;
cin>>time2;
cout<<"The take off time of flight number:"<<flightNo2<<"is:"<<time2<<endl;
cout<<"Please enter the speed of flight number:"<<flightNo2 << endl;
cin>>speed2;
cout<<"The speed of the flight number:"<<flightNo2<<"is:"<<speed2<<endl;
cout<<"Please enter the direction of flight number:"<<flightNo2 << endl;
cin>>direction2;
cout<<"The direction of the flight number:"<<flightNo2<<"is:"<<direction2<<endl;
distance=speed1*time1-speed2*time2;
cout<<"The distance between the two flights be:"<<distance<<endl;
return 0;
}
Requires to follow the program template provided and use stack to solve the problem.
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Example 1:
Input: s = "()"
Output: true
Example 2:
Input: s = "()[]{}"
Output: true
Example 3:
Input: s = "(]"
Output: false
Example 4:
Input: s = "([)]"
Output: false
Example 5:
Input: s = "{[]}"
Output: true
Program Template
#include <stdio.h>
#include <stdlib.h>
// This is where the parentheses are stored in memory
char buffer[1024];
char stack_pop();
void stack_push(char ch);
int stack_size();
int main(){
FILE *fp;
// The parentheses sequences is in the parentheses.txt file.
fp=fopen("parentheses.txt","r");
if(fp==NULL){
printf("The input file does not exist.\n");
exit(-1);
}
// Read the parenthese sequences into buffer array.
fgets(buffer,1024,fp);
//printf("%s",buffer);
}
// The pop operation in the stack. To be done.
char stack_pop(){
return ')';
}
// The push operation in the stack. To be done.
void stack_push(char ch){
}
// The number of elements in the stack. To be done.
int stack_size(){
return 0;
}
What is h(41)-h(40), given the definition of h below?
def h(n):
s = 0
for i in range(1,n+1):
if n%i > 0:
s = s+1
return(s)Consider two entity sets A and B that both have the attribute X (among others whose
names are not relevant to this question).
a. If the two Xs are completely unrelated, how should the design be improved?
b. If the two Xs represent the same property and it is one that applies both to A and to
B, how should the design be improved? Consider three subcases:
X is the primary key for A but not B
X is the primary key for both A and B
X is not the primary key for A nor for B