Programming Exercise 2-7 Tasks Test Case Complete Test case 2 Labl Test Case Complete Test case 3 Test Case Incomplete Test case 4 Input 30980234.5001928 Output Enter decimal value: 30980234.5001928 Decimal nearest value: 30980234 Results % Ⓡ 30980235 Show Details > main.cpp 1 #include 2 #include 3 using namespace std; 4 // Driver code 5 int main() 6 { 7 8 a 9 10 10 11 12 13 14 15 16 17 18} 19 | // variable declaration. float declVal; cout<<"Enter decimal value: "; // taking input from user cin>>declVal; // convert decimal value to nearest int value. int result round (declVal); // print the desired output cout<<"Decimal nearest value: "< Terminal X + Enter decimal value: rm -f a.out g++ -Wall -std=c++0x main.cpp ./a.out Decimal nearest value: 30980235sandbox $ sandbox $ sandbox $ g++ -Wall -std=c++0x main.cpp sandbox $ ./a.out Enter decimal value:

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

debug plss

Programming Exercise 2-7
0 Tasks
<>
go
?
203
Test Case Complete
Test case 2
Test Case Complete
Test case 3
Test Case Incomplete
Test case 4
Input
30980234.5001928
Output
Enter decimal value: 30980234.5001928
Decimal nearest value: 30980234
Results Ⓡ
30980235
Show Details
Run checks
>
Submit 75%
main.cpp
+
1 #include <iostream>
2 #include <cmath>
3 using namespace std;
4 // Driver code
5 int main()
6 {
7
8
9
10
11
12
13
14
15
16
17
18}
19
// variable declaration
float declVal;
cout<<"Enter decimal value: ";
// taking input from user
cin>>declVal;
// convert decimal value to nearest int value
int result = round (declVal);
// print the desired output
cout<<"Decimal nearest value: "<<result;
return 0;
+
>_ Terminal
X +
Enter decimal value: rm -f a.out
g++ -Wall -std=c++0x main.cpp
./a.out
Decimal nearest value: 30980235sandbox $
sandbox $
sandbox $ g++ -Wall -std=c++0x main.cpp
sandbox $ ./a.out
Enter decimal value:
A-Z
V
Transcribed Image Text:Programming Exercise 2-7 0 Tasks <> go ? 203 Test Case Complete Test case 2 Test Case Complete Test case 3 Test Case Incomplete Test case 4 Input 30980234.5001928 Output Enter decimal value: 30980234.5001928 Decimal nearest value: 30980234 Results Ⓡ 30980235 Show Details Run checks > Submit 75% main.cpp + 1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 // Driver code 5 int main() 6 { 7 8 9 10 11 12 13 14 15 16 17 18} 19 // variable declaration float declVal; cout<<"Enter decimal value: "; // taking input from user cin>>declVal; // convert decimal value to nearest int value int result = round (declVal); // print the desired output cout<<"Decimal nearest value: "<<result; return 0; + >_ Terminal X + Enter decimal value: rm -f a.out g++ -Wall -std=c++0x main.cpp ./a.out Decimal nearest value: 30980235sandbox $ sandbox $ sandbox $ g++ -Wall -std=c++0x main.cpp sandbox $ ./a.out Enter decimal value: A-Z V
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT