how to do bold text in c++

and how to make my math answer look like a dollar amount and not a num

Page 1 of 1

5 Replies - 14274 Views - Last Post: 18 October 2010 - 07:19 AM Rate Topic: -----

#1 crumster2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-October 10

how to do bold text in c++

Posted 17 October 2010 - 07:14 PM

how to i get cout to produce its results in bold also need to know how to get my cout for my math answers to look like dollars amounts instead of number ex 80.00 instead of 80 hear is my source doc i need the Projected miles of driving " miles" to be in bold and all answers need to be in dollar amounts like 200.00 not 200


	double 
	 days,			// number of days the customer will have the car in their possession  
	 miles,			// number of miles the customer will drive
	 cost1,			// the cost of the compact car after the miles and days are given 
	 cost2,			// the cost of the luxury car after the miles and days are given
	 dif;			// the difference in price between the compact and luxury cars
	

	


	// miles and days are input variables.  The miles, days, cost1, cost2, and dif are the output variables
	
	cout << " Apex		Auto		Rental. " << endl; 
	cout << " We leave the driving to you " << endl; 
	cout << " " << endl;
	cout << " " << endl;

	//Prompt the user to enter miles driving and days needed
	cout << " Enter projected miles driving. "; 
	cin >> miles;
	cout << " Enter Number of days needed.";
	cin >> days;


// calculate the cost of miles and days for compact car
	    cost1 =  (miles * 0.28) + (days * 17.00);
		  
// calculate the cost of miles and days for luxury
		cost2 =  (miles * 0.35) + (days * 21.00);
// calculate the difference betweenn the two types of cars
	dif = cost2 - cost1 ;		

		
// Displays the miles driving, number of days and the cost of the rental for both models
	cout << " " << endl;
	cout << " " << endl;
	cout << " Projected miles of driving  " << miles  << endl;
	cout << " Number of days"   <<  days  << endl; 
	cout << " " << endl;
	cout << " " << endl;
	cout << " Total cost for a compact car $ " << cost1 << endl;
	cout << " Total cost for a luxury car $ "  << cost2 << endl;
	cout << " " <<endl;
	cout << " " <<endl;
	cout << " There is a difference of $ "<<  dif << endl;
	
	return 0;

}


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 18 October 2010 - 04:15 AM


Is This A Good Question/Topic? 0
  • +

Replies To: how to do bold text in c++

#2 Alex6788  Icon User is offline

  • kitties == adorable


Reputation: 144
  • View blog
  • Posts: 1,667
  • Joined: 15-July 10

Re: how to do bold text in c++

Posted 17 October 2010 - 07:36 PM

Please post code in code tags :code:
More people will help you and it will be easier to read.

This post has been edited by Alex6788: 17 October 2010 - 07:36 PM

Was This Post Helpful? 0
  • +
  • -

#3 shad0wk1  Icon User is offline

  • D.I.C Head

Reputation: 31
  • View blog
  • Posts: 139
  • Joined: 01-October 10

Re: how to do bold text in c++

Posted 17 October 2010 - 07:40 PM

Use code snippet

to share your codes.

when dealing with fraction part, i use <iomanip> try read a bit about it. tips: precision(2),showpoint
Was This Post Helpful? 0
  • +
  • -

#4 bedmond  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 86
  • Joined: 09-October 10

Re: how to do bold text in c++

Posted 18 October 2010 - 04:07 AM

View Postcrumster2, on 17 October 2010 - 06:14 PM, said:

how to i get cout to produce its results in bold also need to know how to get my cout for my math answers to look like dollars amounts instead of number ex 80.00 instead of 80 hear is my source doc i need the Projected miles of driving " miles" to be in bold and all answers need to be in dollar amounts like 200.00 not 200


Are you using float or double to input the dollar amount? Use setprecision to control how many decimals you want http://www.cplusplus...s/setprecision/

And as others have said, we can't really help much without your code
Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6048
  • View blog
  • Posts: 23,473
  • Joined: 23-August 08

Re: how to do bold text in c++

Posted 18 October 2010 - 04:16 AM

There is no standard C++ way to "bold text".
Was This Post Helpful? 1
  • +
  • -

#6 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 282
  • View blog
  • Posts: 1,456
  • Joined: 16-May 09

Re: how to do bold text in c++

Posted 18 October 2010 - 07:19 AM

I guess you could use [NCURSES]/[PDCURSES] libraries for this purpose.

This post has been edited by Anarion: 18 October 2010 - 07:21 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1