Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagenone
linenumberstrue
% Definerer programinput
vareliste = [{ 'Vare1 '; 'Vare2 '; 'Vare3 ']};
antall = [1,1,3] % Antall av hver vare. 
prisliste = [ 20, 32, 16 ];


% Definerer konstant verdi
mva = 0.15;

% Regn ut MVA for hver vare
vareMVA = % MANGLER KODE

% Regn ut total pris for hver vare ( pris + mva )
prisTotal = % MANGLER KODE

% Regn ut total summen for MVA
totalMVA = % MANGLER KODE

% Regn ut totalt beloep aa betale
total = % MANGLER KODE

% Skriv ut kvitteringen

fprintf (' -------------------------------------\n');
fprintf ('Hva \t\ tPris \ tMVA \ tTotal \n');

for i = 1 : length ( vareliste )
	fprintf ('%ix %s\t\t%d\t%d\t%d\n', vareliste (i ,:) , prisliste (i), vareMVA (i),
	prisTotal (i));
end

fprintf (' -------------------------------------\n\n');
fprintf ('Total MVA \t\t\t%d\n', totalMVA );
fprintf ('Total \t\t\t\t%d\n\n', total );
fprintf ('\ tTakk for en koselig \n\t kalkulasjon !\n');
fprintf (' -------------------------------------\n');