Facebook
From Ritchie, 1 Week ago, written in Java.
Embed
Download Paste or View Raw
Hits: 30
  1. package com.company;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.     public static void main(String[] args) {
  6.  
  7.         String name, gender, race, charclass;
  8.         int str, dex, con, intel, wis, cha;
  9.  
  10.         Scanner input = new Scanner(System.in);
  11.         System.out.println("Please enter your character's name: ");
  12.         name = input.nextLine();
  13.  
  14.         System.out.println("Please enter your gender (Male/Female): ");
  15.         gender = input.nextLine();
  16.  
  17.         System.out.println("Please enter your race (Available races: Human/Elf/Dwarf): ");
  18.         race = input.nextLine();
  19.  
  20.         System.out.println("Please enter your class (Available classes: Fighter/Paladin/Ranger/Wizard/Thief): ");
  21.         charclass = input.nextLine();
  22.  
  23.         System.out.println("Please enter your Strength as an Integer: ");
  24.         str = input.nextInt();
  25.  
  26.         System.out.println("Please enter your Dexterity as an Integer: ");
  27.         dex = input.nextInt();
  28.  
  29.         System.out.println("Please enter your Constitution as an Integer: ");
  30.         con = input.nextInt();
  31.  
  32.         System.out.println("Please enter your Intelligence as an Integer: ");
  33.         intel = input.nextInt();
  34.  
  35.         System.out.println("Please enter your Wisdom as an Integer: ");
  36.         wis = input.nextInt();
  37.  
  38.         System.out.println("Please enter your Charisma as an Integer: ");
  39.         cha = input.nextInt();
  40.  
  41.         Character Charo = new Character(name, gender, charclass, race, str, dex, con, intel, wis, cha);
  42.  
  43.         System.out.println("Character Information: ");
  44.         System.out.println("Name: " + Charo.getName());
  45.         System.out.println("Gender: " + Charo.getGender());
  46.         System.out.println("Class: " + Charo.getCharClass());
  47.         System.out.println("Race: " + Charo.getRace());
  48.         System.out.println(" ");
  49.         System.out.println("STR: " + Charo.getSTR());
  50.         System.out.println("DEX: " + Charo.getDEX());
  51.         System.out.println("CON: " + Charo.getCON());
  52.         System.out.println("INT: " + Charo.getINT());
  53.         System.out.println("WIS: " + Charo.getWIS());
  54.         System.out.println("CHA: " + Charo.getCHA());
  55.         System.out.println(" ");
  56.         System.out.print("TOTAL " + Charo.getTotalStat());
  57.  }
  58. }
  59.  
  60. package com.company;
  61.  
  62. public class Character {
  63.     private String Name, CharClass, Gender, Race;
  64.     private int STR, DEX, CON, INT, WIS, CHA, total;
  65.  
  66.     public Character(String Name, String CharClass, String Gender, String Race, int STR, int DEX, int CON, int INT, int
  67.             WIS, int CHA) {
  68.         this.Name = Name;
  69.         this.CharClass = CharClass;
  70.         this.Gender = Gender;
  71.         this.Race = Race;
  72.         this.STR = STR;
  73.         this.DEX = DEX;
  74.         this.CON = CON;
  75.         this.INT = INT;
  76.         this.WIS = WIS;
  77.         this.CHA = CHA;
  78.         TotalStat();
  79.     }
  80.  
  81.     public Character() {
  82.  
  83.     }
  84.  
  85.     public void setName(String Name) {
  86.         this.Name = Name;
  87.     }
  88.  
  89.     public void setCharClass(String CharClass) {
  90.         this.CharClass = CharClass;
  91.     }
  92.  
  93.     public void setGender(String Gender) {
  94.         this.Gender = Gender;
  95.     }
  96.  
  97.     public void setRace(String Race) {
  98.         this.Race = Race;
  99.     }
  100.  
  101.     public void setSTR(int STR) {
  102.         this.STR = STR;
  103.     }
  104.  
  105.     public void setDEX(int DEX) {
  106.         this.DEX = DEX;
  107.     }
  108.  
  109.     public void setCON(int CON) {
  110.         this.CON = CON;
  111.     }
  112.  
  113.     public void setINT(int INT) {
  114.         this.INT = INT;
  115.     }
  116.  
  117.     public void setWIS(int WIS) {
  118.         this.WIS = WIS;
  119.     }
  120.  
  121.     public void setCHA(int CHA) {
  122.         this.CHA = CHA;
  123.     }
  124.  
  125.     public String getName() {
  126.         return Name;
  127.     }
  128.  
  129.     public String getGender() {
  130.         return Gender;
  131.     }
  132.  
  133.     public String getRace() {
  134.         return Race;
  135.     }
  136.  
  137.     public String getCharClass() {
  138.         return CharClass;
  139.     }
  140.  
  141.     public int getSTR() {
  142.         return STR;
  143.     }
  144.  
  145.     public int getDEX() {
  146.         return DEX;
  147.     }
  148.  
  149.     public int getCON() {
  150.         return CON;
  151.     }
  152.  
  153.     public int getINT() {
  154.         return INT;
  155.     }
  156.  
  157.     public int getWIS() {
  158.         return WIS;
  159.     }
  160.  
  161.     public int getCHA() {
  162.         return CHA;
  163.     }
  164.  
  165.     public int getTotalStat() {
  166.         return total;
  167.     }
  168.  
  169.     public void TotalStat() {
  170.         total = getCHA() + getCON() + getDEX() + getINT() + getSTR() + getWIS();
  171.     }
  172.  
  173. }