sweWS1314 aktualisiert

This commit is contained in:
Karp 2014-08-11 17:24:04 +02:00
parent 96f33ea158
commit a720f9ed19

View File

@ -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}