Write a program to take input for n number of doctor records and write records of all cardiologists in a file named: "record1". Also write records of all those doctors in another file named: "record2" who are taking salary more than INR 80,000. After writing records in both files, merge their contents in another file: "finalrecord" and read all records of "finalrecord" file and display on screen. [Attributes of doctor: doc_id, doc_name, doc_specialization, doc_salary]
Create a class named 'Student' with a string variable 'name' and an integer variable 'roll_no'. Assign the value of roll_no as '2' and that of name as "John" by creating an object of the class Student. (For C sharp)
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString
.trim()
.split("\n")
.map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let integers = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here and log the output */
const productArrayItems = arr => arr.reduce((a, b) => a * b)
console.log(productArrayItems(integers));
}
notthis output ----> 1*2*3=6
write a c++ programe which calculates sum of each column and row separately .for this, first create a 2D array 3 rows , 5 columns and then ask the user to input values in the array . after that , first calculate sum of each row separately and display that sum. then calculate sum of each column separatel and display that sum on the screen. to achieve such output , ou need to follow the following instructions?
planting trees:
In planting field, there are trees in a single row fromleft to right.each tree has avalue V.youcut trees fromleft to right and for each tree ofvalue Vthat you cut,youplant(V+1)% M trees on the right most end with values ranging from 0 to ((V+1)%M)-1.
Initially,there was only one tree with value 2.Find the total number of trees present after cutting K trees.
Example:
Input1:1
Input2:2
Output1:1
Harrypotter is visiting his uncle’s house ,the house of Black ,and ants to know more about the family through their ancestral tree.He notices that the ancestraltreebegins with the head of the family at the top,having 2 children as his descendants,This pattern is followed throught and each member is represented by unique integer.
Given relationships in the form ofan integer arraywhere the head of the family is at the first position (i=0) and his children areat position (2*i+1) and (2*i+2).
Your task is to help harry find and return all the siblings of any given family member and return them in the form of a sorted array.
Note:if there are no siblings ,return {-1}.
Example:
Input1:5
Input2:{1,2,3,4,5}
Input3:1
Output:{-1}
you want tobuy a particular stock at its loerest price andsell it later at its highest price,since the stock market is unpredictable,yousteal the price plans of a company for this stockfor the next N days.
Find the best price you can get to buy this stock to achieve maximum profit.
Note:The initial price of the stock is 0.
Input1:Nnumber of days.
Input2:Array representing changein stock price for the day.
Output: Your function must return the best price to buy the stock at.
Example:
Input1:5
Input2:{-39957,-17136,35466,21820,-26711}
Output:-57093
John is going through his family photo album.There is a total of N people in the family labeled 0 to N-1.
Find out the number of members of his family who have more than or equal to X children.
Input specification:
Input1:N,denoting the total number of family members.
Input2:X,denoting the minimum number of children a family members should have in order to be included in john’s final set.
Input3:An array of N elements where the ith element denotes the parent of the ith index. If the value of the element is -1,then that family member has no parent.
Example:
Input1:1
Input2:0
Input3:{-1}
Output=1
Area and circumference a circle
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString.trim().split("\n").map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
/* Please do not modify anything above this line */
function Circle(radius) {
/* Write your code here */
}
/* Please do not modify anything below this line */
function main() {
const radius = JSON.parse(readLine());
const circle1 = new Circle(radius);
console.log(circle1.getArea());
console.log(circle1.getCircumference());
}
Input:7
Output:153.86
43.96
Consider the following declaration and the statements (a) to (d) written in C. Identify the statement which are correct and the ones which has an error, by giving reason. If a statement has an error correct it.
int c = 1, *pc; // declaration
(a) pc = c;
(b) *pc = &c;
(c) pc = &c;
(d) *pc = c;