EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 2, Problem 11RQ
Program Description Answer

The remainder operator is represented by percent sign (%).

Hence, the correct answer is option “D”.

Blurred answer
Students have asked these similar questions
4.7 for repetition  #include <iostream>#include <iomanip>using namespace std;int main(){long USD, maxUSD; // Amount in USDdouble rate; // Exchange rate USD <-> MYRcout << "\n* * * * TABLE OF EXCHANGE * * * *\n ";cout << "* United State Dollar (USD) to Malaysia Ringgit (MYR) *\n\n";cout << "\nPlease give the rate of exchange: ";cout <<" \n\n 1 USD in RM MYR: ";cin >> rate;cout << "\n Please enter the USD you want to change: ";cin >> maxUSD;// Outputs the table & Titles of columns:cout << "\n If Rate Now is : " << rate << endl;cout << "\n so, USD to RM exchange is : "<< endl;cout << '\n'<< setw(12) << "USD" << setw(20) << "MYR";cout << '\n'<< setw(16) << "---------------------------------------------" ;cout << '\n'<< setw(24) << " >>> " ;// Formatting RM-MYR:cout << setprecision(2) << endl;long lower, upper,…
Need help correcting the 24-hour clock as its showing as regular time! #include <iostream>#include <ctime>#pragma warning(disable : 4996) using namespace std; time_t now = time(0);tm* local = localtime(&now); int hour = local->tm_hour;int minutes = local->tm_min;int sec = local->tm_sec; // Function to display the 12-hour clockvoid Clock12() {    // Converts 24-hour clock to 12-hour    if (hour > 12) {        hour -= 12;    }    cout << "*****************************" << "     " << "*****************************\n";    cout << "*       12-Hour Clock       *" << "     " << "*       24-Hour Clock       *\n";    cout << "*         " << (hour < 10 ? "0" : "") << hour << ":" << (minutes < 10 ? "0" : "") << minutes << ":" << (sec < 10 ? "0" : "") << sec << (local->tm_hour < 12 ? " AM" : " PM") << "       *     ";} // Function to display the 24-hour…
Please change this program to #include<stdio.h> #include<iostream>#include<conio.h>using namespace std;int main(){    char V,x;    int charges;    cout<<"Select your vehicle:\nC\t=Car\nB\t=Bus\nT\t=Truck";    cin>>V;    cout<<"Enter days to park the vehicle : ";    cin>>x;    switch(V)    {        case 'C':        {            charges=x*20;              cout<<"Charges for Car is Rs."<<charges ;            break;          }                  case 'B':        {            charges=x*25;            cout<<"Charges for Car is Rs."<<charges;            break;        }                   case 'T':        {            charges=x*30;            cout<<"Charges for Bus is Rs."<<charges;            break;        }                   default:            cout<<"Invalid input";    }    return 0;}
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,