Make a file by yourself named ”Integer.txt” and add 5 integer values in it. Now, write a C++ program that reads data (5 integers) from the file and store them in integer array. Also make another integer array (int result []) of same size to store the results. The program should check for each number in array if it is prime number or not. If the number is prime, update value in result[] array from 0 to 1. Lastly, write output in another file named “Result.txt”
A group of people are playing a game.They are standing and each carring a card with a number on it.These numbers in the list A. A random number S iis selected.
Find out the new list of numbers after
Sample Input1
1,2,3
1
Sample Output1
2 3
1 2
Write a program to print the not repeated string.
Input
The input contains a string S.
Output
The output contains a string, not repeated string.
by CodeChum Admin
There are different kinds of numbers, but among them all, the most commonly used numbers in our daily lives are those positive ones. So, I only want you to count all the positive numbers from the 4 outputted values and print out the result.
Go and search for the positive ones among these four!
Define a function CalcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base. Relevant geometry equations:
Volume = base area x height x 1/3
Base area = base length x base width.
(Watch out for integer division).
Where's the Biggest One?
by CodeChum Admin
We've already tried comparing 3 numbers to see the largest among all, so let's try a more complicated mission where we locate the position of the largest among 5 numbers. There are only 4 possible cases for this mission:
- if the largest digit is the first digit, print "Leftmost"
- if the largest digit is the third digit, print "Middle"
- if the largest digit is the last digit, print "Rightmost"
- if none of the above is correct, print "Unknown"
Now, show me how far you've understood your lessons!
Mobile
i want code in between write code here
"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++];
}
class Mobile {
// Write your code here
}
function main() {
const brand = readLine();
const ram = readLine();
const battery = parseInt(readLine());
const song = readLine();
const isOnCall = JSON.parse(readLine());
const myMobile = // Write your code here
myMobile.fullcharge();
myMobile.playMusic();
myMobile.stopMusic();
myMobile.endCall();
myMobile.makeCall();
myMobile.endCall();
}
Make a file by yourself named ”Integer.txt” and add 5 integer values in it. Now, write a C++
program that reads data (5 integers) from the file and store them in integer array. Also make another
integer array (int result []) of same size to store the results. The program should check for each number
in array if it is prime number or not. If the number is prime, update value in result[] array from 0 to 1.
Lastly, write output in another file named “Result.txt”
Example
Input:
Integer.txt
2 11 1 17 8
Output:
Result.txt
1 1 0 1 0
Hint: Prime number are those which is only divisible by 1 or itself.
Task 2
Write a program which takes 3 students’ data from file (“input.txt”) and displays the grade
obtained by student in new file (“output.txt”).
Hint: The program will read name from the file and then the marks obtained in three subjects.
Add those marks and convert them out of 100 and display the grade obtained by student.
Repeat these steps for three students
Score (out of
100)
Grade
0 – 49.5
F
49.5 – 57.5
D
57.5 – 71.5
C
71.5 – 84.5
B
>= 84.5
A
Task 2
Write a program which takes 3 students’ data from file (“input.txt”) and displays the grade
obtained by student in new file (“output.txt”).
Hint: The program will read name from the file and then the marks obtained in three subjects.
Add those marks and convert them out of 100 and display the grade obtained by student.
Repeat these steps for three students
Score (out of
100)
Grade
0 – 49.5
F
49.5 – 57.5
D
57.5 – 71.5
C
71.5 – 84.5
B
>= 84.5
A