Advertisement
Guest User

Untitled

a guest
Jun 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. // Lecture02.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string>
  7.  
  8. using namespace std; // First cool thing about using the solution-project system. You don't need to remember these lines. Just look at an old homework.
  9.  
  10. int main()
  11. {
  12. int size; //since i'm dealing with size and values, i have to say int: etc; in the beginning"
  13. int value; // use ; after stating your ints
  14.  
  15. cout << "Enter size " << endl; // my first input is size so i make a cout and cin for it
  16. cin >> size; // use ; after endl and cin
  17.  
  18.  
  19. if (size == 4 || size == 6 || size == 8 || size == 10 || size || 12 || size || 20) {
  20. }
  21. else if (size != 4 && size != 6 && size != 8 && size != 10 && size != 12 && size != 20) {
  22. cout << ("That's not a size, I'll use 6") << endl;
  23. size = 6; // my first if deals with size, aka my input. use {} for cout that follows if. use {} for cout that follows else
  24. }
  25.  
  26.  
  27. cout << "Enter value" << endl;
  28. cin >> value;
  29.  
  30. if (value < 0 || value >= size) {
  31. cout << ("Too high, just use 1") << endl;
  32. value = 1;
  33. }
  34.  
  35. if (size == 4 || size == 8 || size == 20) {
  36. cout << " * " << endl;
  37. cout << " * * " << endl;
  38. cout << " * " << value << " * " << endl;
  39. cout << "*********" << endl;
  40. }
  41. else if (size == 6) {
  42. cout << "*********" << endl;
  43. cout << "* *" << endl;
  44. cout << "* " << value << " *" << endl;
  45. cout << "* *" << endl;
  46. cout << "*********" << endl;
  47. }
  48. else if (size == 10) {
  49. cout << ("Kite") << value << endl;
  50. }
  51. else if (size == 12) {
  52. cout << ("Pentagon") << value << endl;
  53. }
  54.  
  55. cin >> value;
  56.  
  57. return 0 ;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement