fork download
  1. #! /usr/bin/perl
  2.  
  3. use warnings;
  4.  
  5. use strict;
  6.  
  7.  
  8.  
  9. print "Programmer: Serafim Kotsogiannis & Kwai Choi", "\n";
  10.  
  11. print "Course : SOSC146, Summer 2012", "\n";
  12.  
  13. print "Lab# : 2, part #2", "\n";
  14.  
  15. print "Due date : 5-15-2012", "\n\n";
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. #Ask for base price of a car
  24.  
  25. my ($value,) ;
  26.  
  27.  
  28. print "Enter the base price of a car: ";
  29.  
  30. chomp ($value = <STDIN>);
  31. print " ", "\n";
  32.  
  33. $a = $value * 0.06;
  34. $b = $value * 0.005;
  35. my $total = $a + $b + $value + 700.00 + 200.00 + 50.00;
  36.  
  37.  
  38. sub roundup {
  39. my $n = shift;
  40. return(($n == int($n)) ? $n : int($n + 1))
  41. }
  42.  
  43.  
  44.  
  45.  
  46. print "Vehicle Base Price........................ $value", "\n";
  47.  
  48. print "Destination Charge........................ 700.00", "\n";
  49.  
  50. print "Documentation............................. 200.00", "\n";
  51.  
  52. print "Prep......................................50.00", "\n";
  53.  
  54. print "License Plate.............................$b", "\n";
  55.  
  56. print "Tax........................................$a", "\n";
Success #stdin #stdout 0s 4728KB
stdin
Standard input is empty
stdout
Programmer: Serafim Kotsogiannis & Kwai Choi
Course : SOSC146, Summer 2012
Lab# : 2, part #2
Due date : 5-15-2012

Enter the base price of a car:             
Vehicle Base Price........................ 
Destination Charge........................ 700.00
Documentation............................. 200.00
Prep......................................50.00
License Plate.............................0
Tax........................................0