Answer:
Explanation:
public class Team {
private String teamName;
private int teamWins;
private int teamLosses;
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public int getTeamWins() {
return teamWins;
}
public void setTeamWins(int teamWins) {
this.teamWins = teamWins;
}
public int getTeamLosses() {
return teamLosses;
}
public void setTeamLosses(int teamLosses) {
this.teamLosses = teamLosses;
}
public double getWinPercentage() {
return teamWins / (double) (teamWins + teamLosses);
}
}
Response: a file containing audio
Clarification:
Respuesta: Te proporcioné 6 opciones de las cuales puedes elegir.
Integridad
Escalabilidad
Calidad de Servicio
Tolerancia a Fallos
Redes de Línea Eléctrica
Seguridad
Answer:
#include <iostream>
using namespace std;
class Digits
{
public:
int num;
int read() //method to read num from user
{
cout<<"Enter number(>0)\n";
cin>>num;
return num;
}
int digit_count(int num) //method to count number of digits of num
{
int count=0;
while(num>0) //loop till num>0
{
num/=10;
count++; //counter which counts number of digits
}
return count;
}
int countDigits(int num) //method to return remainder
{
int c=digit_count(num); //calls method inside method
return num%c;
}
};
int main()
{
Digits d; //object of class Digits is created
int number=d.read(); //num is read from user
cout<<"\nRemainder is: "<<d.countDigits(number); //used to find remainder
return 0;
}
Output:
Enter number(>0)
343
Remainder is: 1
Explanation:
The program has a logical error that needs rectification. A correctly structured program calculates the remainder when a number is divided by the count of its digits. A class named Digits is created, consisting of the public variable 'num' and methods for reading input, counting digits, and calculating the remainder.
- read() - This function asks the user to enter the value for 'num' and returns it.
- digit_count() - This function accepts an integer and counts how many digits it has, incrementing a counter until 'num' is less than or equal to 0. It ultimately returns the digit count.
- countDigits() - This function takes an integer and delivers the remainder from dividing that number by its digit count. The digit count is computed using the 'digit_count()' method.
Finally, in the main function, a Digits object is instantiated, and its methods are utilized to produce an output.