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?\\
|
(3c) State three test cases for the code below. Whih coverage do your test cases provide?\\
|
||||||
|
|
||||||
\begin{lstlisting}[]{}
|
\begin{lstlisting}[]{}
|
||||||
String debitCard (int cardId, float Price){
|
String debitCard (int cardId, float Price){
|
||||||
if(isValid(cardID)){
|
if(isValid(cardID)){
|
||||||
float currentValue = getValue(cardID);
|
float currentValue = getValue(cardID);
|
||||||
if(currentValue < price){
|
if(currentValue < price){
|
||||||
return "Not enough money on card: " + currentValue;
|
return "Not enough money on card: " + currentValue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float newValue = currentValue - price;
|
float newValue = currentValue - price;
|
||||||
setValue(cardId, newValue);
|
setValue(cardId, newValue);
|
||||||
return "New Value: " + newValue;
|
return "New Value: " + newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return "Invalid cardId";
|
return "Invalid cardId";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
\section{Q4: Project \& Change Management}
|
\section{Q4: Project \& Change Management}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user