forked from klausuren/klausuren-allgemein
sweWS1314 aktualisiert
This commit is contained in:
parent
96f33ea158
commit
a720f9ed19
@ -67,22 +67,22 @@
|
||||
(3c) State three test cases for the code below. Whih coverage do your test cases provide?\\
|
||||
|
||||
\begin{lstlisting}[]{}
|
||||
String debitCard (int cardId, float Price){
|
||||
if(isValid(cardID)){
|
||||
float currentValue = getValue(cardID);
|
||||
if(currentValue < price){
|
||||
return "Not enough money on card: " + currentValue;
|
||||
}
|
||||
else {
|
||||
float newValue = currentValue - price;
|
||||
setValue(cardId, newValue);
|
||||
return "New Value: " + newValue;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return "Invalid cardId";
|
||||
}
|
||||
}
|
||||
String debitCard (int cardId, float Price){
|
||||
if(isValid(cardID)){
|
||||
float currentValue = getValue(cardID);
|
||||
if(currentValue < price){
|
||||
return "Not enough money on card: " + currentValue;
|
||||
}
|
||||
else {
|
||||
float newValue = currentValue - price;
|
||||
setValue(cardId, newValue);
|
||||
return "New Value: " + newValue;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return "Invalid cardId";
|
||||
}
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
\section{Q4: Project \& Change Management}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user