Passes test cases 3/5
Sample Input 1
1000
2
3
Sample Output 1
1060
These are just samples. There are other test cases too.
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});
main();
});
function readLine() {
return inputString[currentLine++];
return input === undefined ? undefined : JSON.parse(input);
}
function calculateFinalValueWithAppreciation(principal, time, apprPercentage) {
let finalValue;
finalValue = principal * (1 + time * apprPercentage / 100);
return finalValue;
}
function main() {
const principal = readLine();
const time = readLine();
const apprPercentage = readLine();
const finalValue = calculateFinalValueWithAppreciation(principal, time, apprPercentage);
console.log(finalValue);
}
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});
main();
});
function readLine() {
return inputString[currentLine++];
return input === undefined ? undefined : JSON.parse(input);
}
function calculateFinalValueWithAppreciation(principal, time, apprPercentage) {
let finalValue;
finalValue = principal * (1 + time * apprPercentage / 100);
return finalValue;
}
function main() {
const principal = readLine();
const time = readLine();
const apprPercentage = readLine();
const finalValue = calculateFinalValueWithAppreciation(principal, time, apprPercentage);
console.log(finalValue);
}
Comments
Leave a comment