[Code note] the scoring system (Xiaoxing) and the scoring system Xiaoxing
I ,.
2. Engineering Drawing.
3. Code.
RootViewController. m
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. UIImageView * imageView = [[UIImageView alloc] initWithFrame: CGRectMake (10, 80,300, 50)]; // picture for scoring [imageView setImage: [self setStarImage: @ "4"]; imageView. backgroundColor = [UIColor clearColor]; [self. view addSubview: imageView];} // returns the Image Based on the score-(UIImage *) setStarImage :( NSString *) str {float a = atof ([str UTF8String]); UIImage * image; if (a = 0.000000) {image = [UIImage imageNamed: @ "star0.png"];} else if (a> 0.000000 & a <1.000000) {image = [UIImage imageNamed: @ "star1.png"];} else if (a = 1.000000) {image = [UIImage imageNamed: @ "star2.png"];} else if (a> 1.000000 & a <2.000000) {image = [UIImage imageNamed: @ "star3.png"];} else if (a = 2.000000) {image = [UIImage imageNamed: @ "star4.png"];} else if (a> 2.000000 & a <3.000000) {image = [UIImage imageNamed: @ "star5.png"];} else if (a = 3.0000000) {image = [UIImage imageNamed: @ "star6.png"];} else if (a> 3.000000 & a <4.000000) {image = [UIImage imageNamed: @ "star7.png"];} else if (a = 4.000000) {image = [UIImage imageNamed: @ "star8.png"];} else if (a> 4.000000 & a <5.000000) {image = [UIImage imageNamed: @ "star9.png"];} else if (a = 5.000000) {image = [UIImage imageNamed: @ "star10.png"];} return image ;}